Closed tawera-manaena closed 2 weeks ago
The build-doc deployment seems broken in CI/CD
The build-doc deployment seems broken in CI/CD
I anticipate that at the moment. The sibling PR will need to be approved first as it updates the basemaps-mkdocs
image as required for this PR to pass the checks. Happy to explain any concerns.
Update
The sibling PR has been approved and merged into the basemaps-mkdocs
master branch with a new release. The previously failing check now succeeds. 🎉
This PR is a sibling of this PR in the basemaps-mkdocs repository.
Problem
When formatting markdown (
.md
) files in Visual Studio Code, sublists are lost due to LINZ's formatting rules around how many spaces prescribe a tab.Currently, MkDocs requires sublist items to be indented 4 spaces relative to the parent. Like so:
However, LINZ's Prettier formatting rules (.prettierrc.cjs) trims such occurrences down to 2 spaces:
After the formatting, MkDocs interprets the
Child
sublist item as a member of the parent list. Effectively, the sublist is lost.Solution
I have identified a markdown extension called mdx_truly_sane_lists, which can solve the problem. The extension allows us to override the number of spaces required for MkDocs to preserve a sublist item from 4 spaces to 2 spaces, inline with LINZ's Prettier formatting rules.
Modifications
Sibling pull request
Dockerfile
Added an install command for the
mdx_truly_sane_lists
markdown extension.Updated the MkDocs base image to the latest version (9.5.44).
This pull request
MkDocs configuration (mkdocs.yml)
Updated the mkdocs.yml file of the linz/basemaps repo so that MkDocs uses the extension.
Verification
Building the Docker image
I used the following command to build a Docker image with which I could test my modifications:
Serving MkDocs locally
I then used the following command to serve MkDocs locally using the Docker image:
Testing sublist indent
For the given markdown snippet: