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

docs: setup mkdocs #414

Merged
merged 16 commits into from
Apr 10, 2024
Merged

docs: setup mkdocs #414

merged 16 commits into from
Apr 10, 2024

Conversation

JP-Ellis
Copy link
Contributor

@JP-Ellis JP-Ellis commented Oct 10, 2023

📝 Summary

MkDocs is a popular tool in the Python ecosystem to generate documentation. It has support for parsing Python docstrings in order to generate API documentation quite easily.

The docs can be seen live at:

pact-foundation.github.io/pact-python/

Note that a lot of the 'legacy' codebase will not render correctly. The sections which should be looked at are:

Important

Before this PR is merged, the publication step of the Docs GitHub Action must be modified so that it only runs on master.

🚨 Breaking Changes

🔥 Motivation

Work for this was created during my own development to see the API from an end-users' perspective.

🔨 Test Plan

🔗 Related issues/PRs

@JP-Ellis JP-Ellis self-assigned this Oct 10, 2023
@JP-Ellis JP-Ellis mentioned this pull request Oct 10, 2023
2 tasks
@YOU54F
Copy link
Member

YOU54F commented Oct 12, 2023

Hey hey,

So we sync files from repos to the main docs site

https://github.com/pact-foundation/docs.pact.io?tab=readme-ov-file#automatic-syncing-from-the-markdown-files-in-each-pact-implementation-repository

Pact pythons sync job is here

https://github.com/pact-foundation/docs.pact.io/blob/master/scripts/sync/pact_python.rb

Its pretty easy to update the format on the site to make a readme split out into different sections, and if this creates html, we can render that on the doc site too.

I'm open to any reimagined ideas about the docs, I want to make things easier for devs in their native languages but also want a unified experience for all users so they can see how to do the same Pact thing, across every language in a meaningful way.

I like the idea of correct api documentation that is generated from the code, the code is our source of truth, and I like things like rusts docs for a quick google or searching functions, its consistent across that ecosystem.

Curious to see what it looks like when you get the deployment sorted, or a preview hooked up

@JP-Ellis JP-Ellis added difficulty:medium A moderate task requiring a good understanding of the codebase type:feature New feature area:documentation Relating to the documentation labels Oct 25, 2023
@JP-Ellis JP-Ellis mentioned this pull request Apr 2, 2024
@JP-Ellis
Copy link
Contributor Author

JP-Ellis commented Apr 2, 2024

The work is finally ready for review, and can be viewed online at:

https://pact-foundation.github.io/pact-python/

Important

Before this PR is merged, the publication step of the Docs GitHub Action must be modified so that it only runs on master.

@YOU54F and @mefellows, I would be keen for your review on the docs before it gets merged as this is a rather substantial change, and I want to make sure there are no unforeseen repercussions.

@JP-Ellis JP-Ellis marked this pull request as ready for review April 2, 2024 02:41
JP-Ellis and others added 13 commits April 5, 2024 15:57
MkDocs is a popular tool in the Python ecosystem to generate
documentation. It has support for parsing Python docstrings in order to
generate API documentation quite easily.

Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
The emoji extensions have been incorporated directly into
mkdocs-material.

Signed-off-by: JP-Ellis <josh@jpellis.me>
The scripts are significantly improved to make them easier to use and
maintain.

Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
The main README has been completely overhauled:

- It is now more closely aligned with Pact JS and Pact Go
- It is much shorter, with usage documentation having been moved into
  `/docs`
- Reference to Pact Python `v3` has been added.

Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
This is a major write up of docs for V3. Including the following
changes:

- Adding a timeline to make it clearly visible
- Added usage documentation within the modules
- Consolidated all `Interaction` classes into one module, and hiding the
  sub-modules from the docs.

Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
Fix typos

Authored-By: JosephBJoyce
Cherry-Picked-By: JP-Ellis <josh@jpellis.me>
Due to the processing that is done on files outside of `docs/`, links to
file _inside_ the `docs/` directory do not work.

This adds a hook to MkDocs which rewrites these links.

Signed-off-by: JP-Ellis <josh@jpellis.me>
Specifically, adding `FORCE_COLOR` to ensure we have coloured output (it
is prettier afterall), and making sure `HATCH_VERBOSE` is always enabled
in case there's an error.

Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
@JP-Ellis JP-Ellis merged commit 94984f4 into master Apr 10, 2024
19 of 28 checks passed
@JP-Ellis JP-Ellis deleted the docs/initial-mkdocs branch April 10, 2024 23:34
@JP-Ellis
Copy link
Contributor Author

JP-Ellis commented May 1, 2024

Closes #416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:documentation Relating to the documentation difficulty:medium A moderate task requiring a good understanding of the codebase type:feature New feature
Projects
Status: ✅ Completed
Development

Successfully merging this pull request may close these issues.

None yet

3 participants