Skip to content

Normalise parts of the guides to be included#50

Open
MshBidb wants to merge 5 commits intoup-n-atom:mainfrom
MshBidb:normalise-purchase-instructions
Open

Normalise parts of the guides to be included#50
MshBidb wants to merge 5 commits intoup-n-atom:mainfrom
MshBidb:normalise-purchase-instructions

Conversation

@MshBidb
Copy link
Copy Markdown
Contributor

@MshBidb MshBidb commented Jun 10, 2025

I noticed when going to add a new guide that the same content is reused quite a bit, and some of it was slightly different (which I don't think was intentional).

This PR is an attempt to form some normality between the guides by including common segments.

I was not 100% sure where to put the reused segments, but feel assets/common/ is appropriate.

There is one issue I noticed, which is around the footnote for the LC connector documentation on the Hub 5x; but since this segment is only used on a single page, it's probably okay to deal with that later when it's reused.

MshBidb added 2 commits June 10, 2025 20:28
…n and ensure that changes are not missed from one page to another when they should be equal.
@up-n-atom
Copy link
Copy Markdown
Owner

We're already using the snippets extension so there is no reason to add another hard dependency with the includes plugin mkdocs-include-markdown-plugin

https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#snippets

https://facelessuser.github.io/pymdown-extensions/extensions/snippets/

It has the ability to embed sections so we could just create a monolithic template.md and import the specific sections.

I'd also prefer the frontmatter to simply be ont for the macro.

Also there is already a shared asset folder in the posts directory /docs/posts/shared-assets

This does not expand the ONT name any more.
@MshBidb
Copy link
Copy Markdown
Contributor Author

MshBidb commented Jun 11, 2025

I have addressed the comments.

The new template.md file is created as requested. It requires some frontmatter content else mkdocs will fail to build (I guess we could also rename the file extension).

Now the bigger issue is that the ont from the including files frontmatter will not expand. But I think it may be okay to just remove that entirely?

@up-n-atom
Copy link
Copy Markdown
Owner

The macro plugin in requirements.txt went missing. Could that be the reason if you're rebuilding the env from scratch?

@MshBidb
Copy link
Copy Markdown
Contributor Author

MshBidb commented Jun 11, 2025

That was intentionally removed, but doesn't help even if it's re-enabled. It seems that the prohibitive part of this setup is when we include specific sections.

Variables would expand correctly with the following, but we lose the "monolith" include that you're after.

{% include "posts/shared-assets/template.md" %}

This is likely solveable if you don't mind a bit of Python being included? which is possible using the macros plugin

@up-n-atom
Copy link
Copy Markdown
Owner

We had that before. I pretty much want to keep it as vanilla as possible, just easier to reword.

# --8<-- [start:install-8311]
## Install the 8311 community firmware

As a prerequisite to masquerading as the {{ page.meta.ont }}, is recommended and required for the remainder
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

lost "the 8311 community firmware is recommended..."

Copy link
Copy Markdown
Contributor Author

@MshBidb MshBidb Jun 12, 2025

Choose a reason for hiding this comment

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

Good catch, fixed by a384997 and I've double checked all the others against main

@MshBidb
Copy link
Copy Markdown
Contributor Author

MshBidb commented Jun 12, 2025

We had that before

I think there's a misunderstanding here. macros was added by 0be1aaf and subsequently removed by c558eeb. It's is not a part of main.

I pretty much want to keep it as vanilla as possible

Understood, updated the PR.

@up-n-atom up-n-atom added the enhancement New feature or request label Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants