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

implement documentation syncing with containerd/containerd and on-site rendering #214

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

haddscot
Copy link
Contributor

@haddscot haddscot commented Mar 11, 2024

addresses #163
built on top of #121

this PR implements:

  • tools/refresh-docs.sh -- script to be called by Makefile [make refresh-docs – also made it a dependency of make serve and make *-build]
  • .github/workflows/sync-documentation.yml -- github workflow to call make refresh-docs on a cron schedule of daily at 3am, same as sync-releases.yml. currently set to operate as a pull request, and will currently generate doc sync PR on any other PR creation for the sake of demonstration, but will remove the on: pull_request: ... before merging
  • themes/containerd/layouts/partials/sidebar.html and nested-menu-partial.html -- adapted from hugocodex Auto-collapsing menu, enables browsing documentation

@estesp
Copy link
Member

estesp commented Mar 14, 2024

Looking at the preview here: https://deploy-preview-214--containerd-io.netlify.app/

This is promising progress, but I wonder how we can clean up the footer as shown in the below screen capture? Looks like these are directory names and are listed once for each file in the dir?

docs-pr

@haddscot
Copy link
Contributor Author

Looking at the preview here: https://deploy-preview-214--containerd-io.netlify.app/

This is promising progress, but I wonder how we can clean up the footer as shown in the below screen capture? Looks like these are directory names and are listed once for each file in the dir?

I didn't even notice that, tunnel visioning on the body content.

will replace with links to docs home and the readme and getting started pages for 1.7.x and 1.6.x

@haddscot
Copy link
Contributor Author

shortfalls that should be addressed in followup tasks:

  • images that are linked relative to the file structure of the markdown must be linked relative to the root of the containerd/containerd project, so that when they are rendered to html they will be linked relative to the corresponding v... directory [e.g. v1.7.x]. for example:

the architecture diagram on the 1.7.x README renders because it is linked as ![architecture](docs/historical/design/architecture.png) in the markdown, which is a path relative to the root of the project
the architecture diagram does not render at /docs/v1.7.x/docs/historical/design/architecture/ because it is linked as ![Architecture](architecture.png) in the markdown, which is a link relative to the /docs/historical/design/ directory and not the root of the project.

  • images that are in the repo but not in the docs/ directory aren't currently synced:

see the architecture diagram on the 1.6.x README which was in the design/ directory for that release.

  • in today's community call, we discussed the possibility of the auto-generated title pages that are used to give the sidebar navigation menu its hierarchical structure and dropdown names could potentially be fully fleshed out sub-READMEs.
  • using the weight md header, we could order the docs in the sidebar in a more logical way, so that the Getting Started page isn't listed 4th under docs/ because of the default alphabetization

@haddscot
Copy link
Contributor Author

pinging @kzys @chalin since you both worked on the previous iterations of this task

Copy link

@chalin chalin left a comment

Choose a reason for hiding this comment

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

Great to see progress on #163!

A few drive-by comments:

  1. As mentioned in Host documentation on the website, rather than linking to GH repo #163, I strongly suggest option (1), because it is simplest. Failing that, option (2): use git submodules.

    What is proposed here feels like a custom (and deferred) kind of git "submodules", that will make it challenging to have reproducible builds.

  2. Can you find a way to avoid having "docs" in doc page paths? E.g. /docs/v1.6.x/getting-started/ rather than /docs/v1.6.x/docs/getting-started/.

  3. Switching to use Docsy might make your lives easier when it comes to managing doc versions.

/cc @natedoubleu @caniszczyk

netlify.toml Outdated
@@ -3,7 +3,7 @@ publish = "public"
command = "make production-build"

[build.environment]
HUGO_VERSION = "0.111.3"
HUGO_VERSION = "0.123.7"
Copy link

Choose a reason for hiding this comment

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

Unless you really need Hugo 0.123.7, I'd suggest that you upgrade the Hugo version separately to have having too many moving parts. Hugo 0.123.x has a rewritten core, and they're still ironing out the bugs, e.g., see open-telemetry/opentelemetry.io#4064.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@haddscot haddscot Mar 18, 2024

Choose a reason for hiding this comment

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

gonna use 0.122.0 0.116.0 for now since it's the last release before the rewritten core, and because newer versions run into weird errors building jquery

@@ -20,7 +20,7 @@
<br />

<div class="buttons is-centered">
<a class="button is-medium is-radiusless is-borderless has-text-weight-bold" href="/docs/getting-started">
<a class="button is-medium is-radiusless is-borderless has-text-weight-bold" href="/docs/v1.7.x/docs/getting-started/">
Copy link

Choose a reason for hiding this comment

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

You might want to use /docs/latest and define a redirect rule that refers back to the latest version.

@haddscot haddscot force-pushed the squash_doc_hosting branch 3 times, most recently from 4dba8bd to 30d9000 Compare March 18, 2024 22:19
@haddscot
Copy link
Contributor Author

haddscot commented Mar 18, 2024

A few drive-by comments:

  1. As mentioned in Host documentation on the website, rather than linking to GH repo #163, I strongly suggest option (1), because it is simplest. Failing that, option (2): use git submodules.
    What is proposed here feels like a custom (and deferred) kind of git "submodules", that will make it challenging to have reproducible builds.

✅ rewrote refresh-docs.sh to use submodules instead

  1. Can you find a way to avoid having "docs" in doc page paths? E.g. /docs/v1.6.x/getting-started/ rather than /docs/v1.6.x/docs/getting-started/.

I could, but the reason I did it this way is because of the relative links to images and other pages in the original markdown – see the first example here. maintaining the directory structure – i.e. treating https://containerd.io/docs/v{$X_VERSION}.x/ as equivalent to the containerd project root – prevents us from having to do changes the links in the markdown

  1. Switching to use Docsy might make your lives easier when it comes to managing doc versions.

can you clarify what specifically you mean when you say "managing doc versions"? the way I see it, this change doesn't add any responsibility of managing doc versions to the .io repo beyond simply updating to whatever the latest changes are on the specified branches of the containerd repo on a daily cadence.

@haddscot haddscot force-pushed the squash_doc_hosting branch 3 times, most recently from a19ec84 to 20cb44d Compare March 19, 2024 18:52
@haddscot
Copy link
Contributor Author

squashed everything up to this point because of trailing whitespace errors in the CI job

Signed-off-by: Scott Haddlesey <[email protected]>
@haddscot haddscot requested a review from chalin March 27, 2024 17:01
@AkihiroSuda AkihiroSuda requested review from estesp and removed request for chalin September 18, 2024 23:41
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.

5 participants