petereon / beaupy

A Python library of interactive CLI elements you have been looking for
https://petereon.github.io/beaupy/
MIT License
192 stars 14 forks source link

Copy button added to code block in documentation #98

Closed HYP3R00T closed 1 month ago

HYP3R00T commented 1 month ago

In the existing documentation, we don't have any option to copy the example code. We have to manually select and copy it.

Material for MkDocs provides an easy way to integrate this feature. So, I have added that to our mkdocs.yml. This allows the users to copy the sample code easily and test it in their local system.

Also, in future, when we add more examples, the users will be able to take advantage of the simple copy button.

NOTE: As I am facing an issue with testing the code (#97), this pull request is not tested as instructed in the development section. However, as it is a very minor change to the yml file of the documentation (which doesn't affect the code), I believe we can skip the testing for this one.

petereon commented 1 month ago

Thank you very much for a contribution, it looks very good.

However, last time I've tried to build the docs it wasn't able to build properly in the CI. The tool that's used to build the docs, novella, is no longer maintained. Seems to be a pattern with tooling I opted to use with the beaupy 🥲

HYP3R00T commented 1 month ago

Thanks for responding so promptly. May I ask, what was the initial reason to utilise novella? I have used mkdocs before and never felt the need to preprocess it in an isolated environment. mkdocs doesn't modify any files of the project (as far as I know). Can't we eliminate the need for novella and create a simple pipeline to publish it directly?

However, last time I've tried to build the docs it wasn't able to build properly in the CI.

How can we then merge this change into the project if the CI is building it properly?

HYP3R00T commented 1 month ago

Thanks for responding so promptly. May I ask, why we have novella integrated into this project? As far as I understand, it's basically a build system designed to process files in a temporary directory isolated from the project's source code. But, when we generate a static site using mkdocs, it doesn't modify any source code of the project. Can't we completely get rid of novella and modify the pipeline to build a static site using mkdocs build?

However, last time I've tried to build the docs it wasn't able to build properly in the CI. The tool that's used to build the docs, novella, is no longer maintained.

As the automatic merging is not working, what can I do to integrate the change into the project?

petereon commented 1 month ago

Apologies for brevity and lack of structure, I am only available from the phone atm.

I might be remembering this incorrectly but I believe novella was being used to build the markdown API doc from Python docstrings and to the best of my research, mkdocs didn't do that at the time I postulated the job to build the docs.

I am more than happy to look into alternatives soon.

As for the merging, automatic merging is not enabled for this repo, there is no issue merging these changes outside of the fact documentation doesn't currently build on release.

petereon commented 1 month ago

Thanks, I am going to merge these changes and I'll work on dealing with the documentation build issue.