Skip to content

Add Help page with generated markdown output for all commands and topics #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ header_pages:
- crates.md
- search.html
- docs/index.md
- docs/index-alr.md

# Devlopr
author_logo: profile.png
Expand Down
73 changes: 73 additions & 0 deletions docs/index-alr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Help
description: "alr manual pages"
layout: default
---
<div class="card">
<style>
/* Create two equal columns that floats next to each other */
.doc_toc {
float: left;
width: 15em;
}

.doc_content {
float: left;
width: calc(100% - 15em);
}

/* Clear floats after the columns */
.doc_row:after {
content: "";
display: table;
clear: both;
}

/* Responsive layout - makes the two columns stack on top of each other instead
of next to each other */

@media screen and (max-width: 60em) {
.doc_toc {
width: 100%;
}
.doc_content {
width: 100%;
}
}

/* Table-of-content style */
#markdown-toc {
padding-left: 1em;
font-size: smaller;
}
#markdown-toc ul {
padding-left: 1em;
}


</style>
<div class="doc_row">
<div class="doc_toc">
<div markdown="1">

* Do not remove this line (it will not be displayed)
{:toc}

</div>
<small style="color:#808080">
This help documentation has been generated from the builtin `alr` help
messages. Don't hesitate to suggest fix(es) and/or improvement(s) in
the <a href="https://github.com/alire-project/alire/src/alr">GitHub
repository.</a>
</small>
</div>
<div class="doc_content" markdown="1">

<!-- All the empty lines below, as well as the absence of indentation, seem to
be required for a correct parsing of the markdown files -->

{% include_relative alr.md %}

</div>
</div>
</div>
11 changes: 11 additions & 0 deletions update-gh-pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ cp alire/doc/* docs/
# Append the built-ins config doc generated from the tool
alr --no-tty config --builtins-doc >> docs/configuration.md

# Add the `alr` help page
alr dev --help-doc-markdown > docs/alr.md

# Warn if there are any unquoted <placeholder> from messages, since they are
# incorrectly evaluated by Jekyll and the format will be broken.
# When this happens, the probable solution is to wrap these placeholders with
# CLIC.Formatter.Terminal
if grep -Hn '<[a-z_]*>' docs/alr.md | grep -v '`' ; then
echo 'Warning: <placeholder> found not quoted as `code` in docs/alr.md' >&2
fi

# Cleanup alire repo
rm -rf alire/

Expand Down