Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull requests adds a plugin that generates a html static site for xmake's documentation.
The framework will build the site by iterating over the markdown files in
xmake/plugins/gendoc/doc
and converting them to html using a native module based on cmark.Each .md file must begin with metadata. The metadata and everything before it will be discarded when rendering a page.
Every key must be unique as they are used to identify a page and create links to it from other pages. Keys may only contain alphanumerical and underscore (
_
) characters.When editting a .md file, special values can be used to be replaced with generated content:
${anchor:key}
(example) is used to add an id attibute to the html tag so that links can redirect to it.${link:key}
(example) is used to generate a link to an anchor that may be in another page. They can and should be used in code blocks too.Each .md file should represent exactly one API. They are groupped by page which are defined in pages.lua.
Pages are groupped by category whose name is given by the
title
field.For each page, the site route is generated by concatenating the site root, the locale (ie.
en-us
), and the page'spath
field.docdir
field is the path relative toxmake/plugins/gendoc/doc/LOCALE
from which all direct .md files will be pulled to fill the page.Markdown files are appended to a page by following the alphanumerical order. You can for example prefix a .md file with
0_
to force it being the first file appended to a page.