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

Add projects from Python-Markdown's wiki #134

Merged
merged 3 commits into from
Sep 28, 2023
Merged

Conversation

pawamoy
Copy link
Sponsor Collaborator

@pawamoy pawamoy commented Sep 24, 2023

What kind of change does this PR introduce?

  • Add a project
  • Update a project
  • Remove a project
  • Add or update a category
  • Change configuration
  • Documentation
  • Other, please describe:

Description:
#128

I used the markdown category and label everywhere. Maybe at some point we'd want to better categorize markdown extensions. I didn't verify if the old extensions work with recent versions of Python-Markdown.

Checklist:

  • I have read the CONTRIBUTING guidelines.
  • I have not modified the README.md file. Projects are only supposed to be added or updated within the projects.yaml file since the README.md file is automatically generated.

@pawamoy
Copy link
Sponsor Collaborator Author

pawamoy commented Sep 24, 2023

Super nice checks in CI. Some extensions indeed do not provide a Python-Markdown entrypoint, I wasn't sure if it is still able to load them with the path of the module containing the makeExtension function. If that's not the case, I'll remove these extensions.

@pawamoy
Copy link
Sponsor Collaborator Author

pawamoy commented Sep 24, 2023

Ha, the bugzilla extension uses old relative imports (without leading dots), so I suppose it wouldn't even work. I'll remove it.

@pawamoy
Copy link
Sponsor Collaborator Author

pawamoy commented Sep 24, 2023

Would be nice if the CI report could show links to the repositories 🙂

@pawamoy
Copy link
Sponsor Collaborator Author

pawamoy commented Sep 24, 2023

What does "Also not found as a direct import." mean?

For example Semantic Data packages a mdx_semanticdata.py module, which exposes a makeExtension function. If Python-Markdown accepts module paths, then mdx_semanticdata as extension name should work, right?

@pawamoy
Copy link
Sponsor Collaborator Author

pawamoy commented Sep 24, 2023

Looking at the code, I see that a simple search for makeExtension is made in package.py or package/__init__.py. Another approach would be to use static analysis with Griffe to find if such a function is exposed through imports (including wildcard ones):

from griffe.loader import GriffeLoader

loader = GriffeLoader(search_paths=[directory])
loader.load_module(base_path)
loader.resolve_aliases()
if "makeExtension" in loader.modules_collection[base_path].members:
    break

That doesn't explain why makeExtension is not currently detected in mdx_semanticdata though 🤔
EDIT: ah, that's my bad, I used semanticdata and not mdx_semanticdata as extension.

@oprypin
Copy link
Contributor

oprypin commented Sep 24, 2023

@pawamoy mdx_semanticdata should be written then but seems that you specified semanticdata for it?

@pawamoy
Copy link
Sponsor Collaborator Author

pawamoy commented Sep 24, 2023

Yep, just saw that! Pushed a fix

@pawamoy pawamoy merged commit b759762 into main Sep 28, 2023
2 checks passed
@pawamoy pawamoy deleted the python-markdown-wiki branch September 28, 2023 12:06
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.

None yet

2 participants