Skip to content
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

Convert from AsciiDoctor to Material for MkDocs #80

Merged
merged 6 commits into from
Nov 13, 2024
Merged

Conversation

thatplguy
Copy link
Collaborator

This PR is an experiment in using Material for MkDocs to design a single, consolidated docs page – see this ticket for why I picked Material for MkDocs.

I've incorporated my progress on the language reference (in docs/reference) and accompanying general CN documentation (in docs/specifications), along with the structure of the CN tutorial (in docs/getting-started/tutorials) and the contents of the first tutorial section – porting from asciidoctor was pretty straightforward.

Here's what it looks like:
Screenshot 2024-08-22 at 9 36 44 PM

You can build and run it on localhost:8000 as follows:

# Install Material for MkDocs
pip install mkdocs-material

# In the cn-tutorial root directory, run
mkdocs serve

I'd like to hear your thoughts on:

  1. Is it worth having a single documentation website that also contains the tutorial, or would you prefer the tutorial remain separate?
  2. Should we use Material for MkDocs? Feel free to comment on this ticket as well. (If we decide to use something else, it won't be hard to shift the language reference content to a new platform.)
  3. What do you think about the overall structure – does the top-level navigation make sense content-wise?
  4. Thoughts on the language reference and spec documentation so far? There's more content to add, and @cp526 I'll probably be bugging you in the near future to help me understand the missing bits 🙂

@thatplguy thatplguy requested review from cp526 and bcpierce00 August 23, 2024 04:53
@bcpierce00
Copy link
Collaborator

bcpierce00 commented Aug 28, 2024

Is it worth having a single documentation website that also contains the tutorial, or would you prefer the tutorial remain separate?

The tutorial should definitely be integrated with other docs.

Should we use Material for MkDocs? Feel free to comment on https://github.com/GaloisInc/VERSE-Toolchain/issues/119 as well. (If we decide to use something else, it won't be hard to shift the language reference content to a new platform.)

Looks fine. (One little thing I notice is that the "include an example here" idiom is a bit verbose and requires writing the name of the file to include twice, which is not nice. This can obviously be solved by a little preprocessing, as we're doing now, but perhaps there's a cleaner fix.)

What do you think about the overall structure – does the top-level navigation make sense content-wise?

Haven't gone over it with a fine-tooth comb yet, but to a first approximation it looks pretty good.

We'll want to finalize and merge the new notation branch before converting the tutorial fully to this format.

@thatplguy
Copy link
Collaborator Author

Thanks @bcpierce00. Here's what I see as next steps:

  1. @cp526 should take a look and veto/approve switching to mkdocs
  2. Finalize and merge the new notation branch
  3. Convert the tutorial to mkdocs on this branch (I can do this)
  4. Finalize and merge this branch, and use mkdocs going forward

@cp526
Copy link
Collaborator

cp526 commented Oct 14, 2024

Since the naming conventions branch is now merged, we're no longer blocked on that here. I'm happy for us to go ahead with the Material on mkDocs scheme for the unified CN documentation.

@thatplguy
Copy link
Collaborator Author

Great, thank you @cp526!

@septract
Copy link
Collaborator

My PR #40 is not about the content of the tutorial but rather the CI setup around the Coq examples. So that should not block merging this once it's ready. The Coq stuff needs to be resolved but we're going to wait until the repo split (whenever that happens).

@thatplguy thatplguy force-pushed the cns/material-mkdocs branch from a0d0268 to b4f58bb Compare October 24, 2024 14:55
@thatplguy thatplguy force-pushed the cns/material-mkdocs branch from b4f58bb to 6fbff0e Compare October 24, 2024 20:31
- building examples now places them in docs/exercises and docs/solutions rather
  than build/
- mkdocs is responsible for compiling from docs/ to build/ and depends on the
  examples already being in place (reflected in the Makefile)
- CI now tests building the tutorial in PRs
- CI has been updated to publish the new docs to GitHub Pages
@thatplguy thatplguy force-pushed the cns/material-mkdocs branch from a731ac4 to 17aa9f1 Compare October 25, 2024 17:05
@thatplguy thatplguy changed the title WIP: Skeleton for Material for MkDocs Convert from AsciiDoctor to Material for MkDocs Oct 25, 2024
@thatplguy thatplguy marked this pull request as ready for review October 25, 2024 17:28
@thatplguy
Copy link
Collaborator Author

@cp526 @bcpierce00 this is ready to go. There are no semantic changes to the tutorial, but I did rearrange the structure so that each chapter is in a separate file.

Do you want to take a look before I merge this?

@cp526
Copy link
Collaborator

cp526 commented Nov 1, 2024

LGTM. @bcpierce00 ?

@bcpierce00
Copy link
Collaborator

bcpierce00 commented Nov 1, 2024 via email

@bcpierce00
Copy link
Collaborator

OK, I can build it now, and I agree from a bit of spot-checking that it looks pretty good. I'm fine with merging.

I do have a few questions though about what's included in the layout -- in particular, I don't understand what's included in the sidebars...
image
In the main text area, the headers are Specifications, Special comments, and Kinds of Specs. But the second and third of these don't appear in the list on the left. What does appear on the left is what seem to be subheaders in the main text, but there are some on the left that do not seem to appear in the main text. So... what goes on the left, what goes on the right, what goes both and what goes neither?

@thatplguy
Copy link
Collaborator Author

The top and sidebars are defined in mkdocs.yaml (the nav key at the bottom) and are defined independently from what appears in the main text. Top menu bar items are the outermost level, followed by the left sidebar. The right sidebar is the table of contents for the page being viewed. In this case, that's where "Special comments" and "Kinds of specs" appear.

Here's an example.

nav:
  - Getting started:                                # Top menu item 1
    - README.md                                     # Default page shown when "Getting started"
                                                    # menu item is clicked
    - Installation: getting-started/installation.md # Left menu item 1
    - "Hello world": getting-started/hello-world.md # Left menu item 2
    - Tutorials:                                    # Left menu group heading (bolded)
      - getting-started/tutorials/README.md         # Default page shown when "Tutorials" is clicked
      - "Basic usage": getting-started/tutorials/basic-usage.md
  - Specifications:                                 # Top menu item 2

- pymdownx.tilde

# Page tree
nav:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bcpierce00 this is where the top and side menu bars are defined.

@bcpierce00
Copy link
Collaborator

OK, I see -- it makes more sense now.

One thing that would have helped me would be to adjust the fonts a bit on the left-hand side -- make the "Getting Started" at the top left larger than the boldface headers below it (which should themselves, IMO, be a bit larger than the other text there).

@thatplguy thatplguy merged commit 34c0371 into main Nov 13, 2024
2 checks passed
@thatplguy thatplguy deleted the cns/material-mkdocs branch November 13, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants