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

mkdocs-filter-and-sort #99

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

plbremer
Copy link

updated mkdocs.yaml and added .js files such that generated documentation has filter/sort capabilites for tables.

example:
image

@sujaypatil96 sujaypatil96 self-requested a review February 12, 2024 22:06
Copy link
Member

@sujaypatil96 sujaypatil96 left a comment

Choose a reason for hiding this comment

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

@plbremer thank you for adding the functionality to sort and filter tables in the generated HTML docs/webpages, it's much appreciated!!

One thing that I'm skeptical about is putting the additional javascript files in the src/docs/ folder. I don't know if the intention for that folder is that it should contain only markdown, or if it's also okay to put in scripts that are required for building customized documentation.

Feel free to bring this discussion/topic to a LinkML developers call, or if you're unavailable during that time I can bring it up on the next call and let you know what the consensus is. I'll ask if it's okay to put the javascript files in src/docs/ or if people would prefer we make another new folder at the same level as docs/ called say scripts/ which can contain additional scripts that may or may not be limited to javascript (i.e., can include python and so forth as well) and have them be copied over into the destination documentation folder so that mkdocs can look for it.

We may or may not need to update to the gendoc Makefile target/rule here depending on what we decide: https://github.com/linkml/linkml-project-cookiecutter/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/Makefile#L195-L197

Another possible concern/caveat is that for some HTML tables we are displaying the contents of that table in a "hierarchially indented" fashion. For example, see this table: https://microbiomedata.github.io/nmdc-schema/#classes

Filtering is pretty straightforward but we haven't discussed how sorting should work on a table like this yet.

@cmungall
Copy link
Member

@plbremer
Copy link
Author

Hi Sujay/Chris,

  1. If you could generate a response on my behalf for the /src/docs portion, that would be great.
  2. I agree that the make gendoc command works as is, but might require reworking
  3. @cmungall Indeed, I followed that guide to get the sorting working. Then, I roughly applied the same steps to get the filtering working using a different "javascript library".
    3 continued) Well, I guess I would defer to the maintainers of LinkML for how the indentation ought to work. One could imagine obsoleting the quandary by only permitting the filtering portion of this PR.

Please let me know your thoughts.

@noelmcloughlin
Copy link
Contributor

noelmcloughlin commented Feb 26, 2024

Including extra javascript under src/docs/ is probably okay. Sandboxed environments cannot retrieve mermaid from internet for example: fralau/mkdocs-mermaid2-plugin#64 and make gendoc works without changing Makefile

@sujaypatil96
Copy link
Member

sujaypatil96 commented Mar 1, 2024

Would it be too much work for you to split this out into two separate PRs @plbremer? The reason I ask is because I know we definitely want to have filtering on tables by default, but what I'm not super sure about is sorting, and that's because of the hierarchically indented table view that I mentioned in my above comment.

@plbremer
Copy link
Author

plbremer commented Mar 6, 2024

Would it be too much work for you to split this out into two separate PRs @plbremer? The reason I ask is because I know we definitely want to have filtering on tables by default, but what I'm not super sure about is sorting, and that's because of the hierarchically indented table view that I mentioned in my above comment.

np
#104
#105

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