Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Parser for converting python docstrings to .astro files for the Astro static site generator.
Readme
Yapper converts Python docstrings to astro
files for use by the Astro static site generator.
It uses griffe
to parse python modules and extracts numpy style docstrings.
Docstrings and parameter descriptions will be passed through as raw markdown wrapped in Astro <Markdown is:raw></Markdown>
components.
Class and function elements are wrapped with html
with css
classes that can be styled from Astro.
See the
cityseer.benchmarkurbanism.com
documentation site and associated docs repo for a working example.
Conversion of markdown formatting, code blocks, admonitions, etc., is all handled downstream by Astro's remark and rehype plugins. Styling is likewise handled downstream via css
targeting the associated element classes.
Configuration is provided in pyproject.toml
file placed in the current directory, else a --config
parameter can be provided with a relative or absolute filepath to a toml
config file.
yapper --config ./custom_config.toml
The toml
file must include a [tool.yapper]
section, with keys corresponding to the default configuration options:
[tool.yapper]
package_root_relative_path = './'
intro_template = """
---\n
import { Markdown } from 'astro/components';\n
---\n
"""
outro_template = ""
module_map = [
{ module = "test.mock_file", astro = "./tests/mock_default.astro" },
]
If you want to wrap the .astro
output in a particular layout, then set the intro_template
and outro_template
accordingly, for example, the following will import the PageLayout
layout and will wrap the generated content accordingly:
[tool.yapper]
package_root_relative_path = './'
intro_template = """
---\n
import { Markdown } from 'astro/components';\n
import PageLayout from '../layouts/PageLayout.astro'\n
---\n
\n
<PageLayout>
"""
outro_template = """
</PageLayout>\n
"""
module_map = [
{ module = "test.mock_file", py = "./tests/mock_file.py", astro = "./tests/mock_default.astro" },
]
The module_map
is mandatory and specifies the names of the python modules to be processed via the module
key and an astro
key corresponding to the output file:
yapper
uses a pyproject.toml
file to specify project dependencies and scripts related to project development and publishing.
See pyproject.toml
for available scripts.
FAQs
Parser for converting python docstrings to .astro files for the Astro static site generator.
We found that yapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.