1.9 KiB
1.9 KiB
AGENTS.md
Purpose
This project is a small Markdown-to-HTML utility used behind NGINX.
When a .md file is requested, md2html.php loads the Markdown, converts it with Parsedown, and renders HTML styled by markdown.css.
Key Files
md2html.php: entrypoint for conversion and HTML output.markdown.css: visual styling for rendered Markdown (.markdown-body).composer.json: PHP dependency config (erusev/parsedown).
Environment Assumptions
- Project root:
D:\www\md2html - Markdown files are resolved from
D:\www\... - CSS is currently linked as
//localhost/md2html/markdown.css
Change Priorities
- Keep output readable on desktop and mobile.
- Preserve Markdown semantics generated by Parsedown.
- Avoid introducing JS unless explicitly required.
- Keep the utility simple and fast.
Styling Rules (markdown.css)
- Style only inside
.markdown-bodyunless there is a strong reason to change global page behavior. - Must cover: headings, links, lists, blockquotes, inline code, code blocks, tables, images, hr.
- Keep strong contrast and accessible font sizes.
- Ensure long code lines and wide tables remain usable on small screens (
overflow-x). - Prefer CSS variables for colors and spacing to simplify future theme changes.
PHP Rules (md2html.php)
- Keep dependency loading via
vendor/autoload.php. - Keep response minimal:
<!doctype html>, UTF-8 meta, stylesheet link, wrapped content. - Do not remove
.mdextension guard. - Any path-handling changes must remain compatible with Windows paths.
Recommended Validation After Edits
- Open at least one Markdown file with:
- headings (
#,##,###) - lists
- fenced code block
- table
- blockquote
- image
- headings (
- Verify layout on desktop and mobile width.
- Verify links and code blocks remain readable.
Non-Goals
- Building a full CMS.
- Adding heavy frontend frameworks.
- Replacing Parsedown unless explicitly requested.