This package used to handle the index.html
change for Parity projects that have their versioned
rustdocs published in GitHub Pages. An example is
Substrate, with the rustdocs deployed at its
gh-pages
branch.
Usage: index [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
init <ghRepo> <projectName> [outputPath] initialize an index page
upsert [options] <inputPath> <ref> [display] upsert a REF into the index page
rm [options] <inputPath> <ref> remove a REF from the index page
help [command] display help for command
-
To generate a new
index.html
, run something like:index-tpl-crud init substrate Substrate index.html
<ghRepo>
: Required. This is the name of the repository without the Github user or organization name. So for Substrate with repo url at /~https://github.com/paritytech/substrate, usesubstrate
.<projectName>
: Required. Project name it will display as.[outputPath]
: Optional. The output. If unspecified, it will beindex.html
.
-
To add a new version of rustdocs, run something like:
index-tpl-crud upsert -l index.html monthly-2021-10
-l
: Flag. Specified this ref has been aliased aslatest
as well.<inputPath>
: Required. The input file, where it read the html content, update them, and write to also.<ref>
: Required. The branch or tag of source where the rustdocs is built from.[display]
: Optional. The name of the link. If unspecified, it will use the value ofref
.
-
To remove a version of rustdocs, run something like:
index-tpl-crud rm index.html monthly-2021-10
parameters similar to
upsert
sub-command. -
Modify
src/templates/template.ejs
to update the style of the generated index page usinginit
.upsert
andrm
subcommands do not update the page style and only update the DOM tree within#rustdoc-list
CSS ID.