Skip to content

Commit

Permalink
Merge pull request #3087 from input-output-hk/rvl/adp-1358/fix-docs
Browse files Browse the repository at this point in the history
docs: Fix links on CLI manual
  • Loading branch information
rvl authored Jan 21, 2022
2 parents 45488cf + 18e6f68 commit f7532fc
Show file tree
Hide file tree
Showing 7 changed files with 393 additions and 218 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ jobs:
docs:
runs-on: ubuntu-20.04
steps:
- name: '📥 Checkout repository'
- name: 'Checkout repository 📥'
uses: actions/checkout@v2

- name: '🔧 Build emanote site'
- name: 'Build emanote site 🔧'
run: |
cd docs
mkdir -p output.docker
docker run -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -v $PWD:/data sridca/emanote emanote --layers "/data;/data/.deploy/github" gen /data/output.docker
docker run \
-e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 \
--tmpfs /tmp \
-v $PWD:/data sridca/emanote \
emanote --layers "/data;/data/.deploy/github" gen /data/output.docker
cp -r output.docker ../_build # Ditch docker created root-owned files
bash ../_build/_emanote-bin/compile-css
- name: '📸 Build Documentation'
- name: 'Build Documentation 📸'
id: build
run: |
if [[ $GITHUB_REF =~ ^refs/tags/v ]]; then
Expand All @@ -41,7 +44,7 @@ jobs:
Source commit: ${{ github.sha }}
- name: '📘 Publish'
- name: 'Publish 📘'
if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion docs/.envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use nix
use flake ..#docs
29 changes: 29 additions & 0 deletions docs/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,38 @@

page:
siteTitle: Cardano Wallet
headHtml: |
<snippet var="js.fixAnchorLinks" />
template:
theme: red
sidebar:
collapsed: false
urlStrategy: pretty

js:
fixAnchorLinks: |
<script>
// Keep \#links on the same page, when they would otherwise redirect to
// the page's <base href>. Ref: https://stackoverflow.com/q/8108836
(function() {
function fixLink(el) {
if (el.tagName.toLowerCase() === "a") {
console.log("fixLink", el);
var href = el.getAttribute("href");
if (href && href.indexOf("#") === 0) {
el.href = location.pathname + el.getAttribute("href");
}
}
}
// Adjust href for all existing links.
document.addEventListener("DOMContentLoaded", function() {
const es = document.getElementsByTagName("a");
for (var i = 0; i < es.length; i++) {
fixLink(es[i]);
}
});
// Adjust href for dynamically added links - when they are clicked.
document.addEventListener("click", function(ev) { fixLink(ev.target); });
})();
</script>
1 change: 0 additions & 1 deletion docs/shell.nix

This file was deleted.

Loading

0 comments on commit f7532fc

Please sign in to comment.