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 support for METAFONT #3465

Merged
merged 7 commits into from
Jun 7, 2022
Merged

Conversation

LaeriExNihilo
Copy link
Contributor

Includes support for Donald Knuth's historic language for fontdesigning and fontmaking. While this language is outdated in many regards its legacy endures in METAPOST and PGF/TikZ, and its macro core principle has real depth. May be of use for people exploring the inception of the TeX ecosystem.

Includes the METAFONT language to supported languages in Prism.
METAFONT is a language for fontdrawing and fontmaking, especially for fonts destined to TeX. While old in various regards its legacy endures in METAPOST or in the TikZ syntax.
@github-actions
Copy link

github-actions bot commented Jun 5, 2022

JS File Size Changes (gzipped)

A total of 2 files have changed, with a combined diff of +2.06 KB (+76.9%).

file master pull size diff % diff
components/prism-metafont.min.js 0 Bytes 2.05 KB +2.05 KB +100.0%
plugins/show-language/prism-show-language.min.js 2.68 KB 2.69 KB +12 B +0.4%

Generated by 🚫 dangerJS against 169afba

Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @LaeriExNihilo!

The language itself looks good, but there aren't enough tests, so our regex coverage fails. You can see the untested regexes/alternatives here or by running npm run regex-coverage.

components/prism-metafont.js Outdated Show resolved Hide resolved
Future more widely used languages may be more suited for the mf alias or .mf extension.
Added comprehensive tests for all features.
Added forgotten operators =:| and ||:.
Added forgotten constant _.
Added forgotten quantities pen_bot, pen_lft, pen_rt and pen_top.
@LaeriExNihilo
Copy link
Contributor Author

This should pass now @RunDevelopment . While doing the tests I also found a few mistakes in my definitions so it was a good opportunity.

@RunDevelopment
Copy link
Member

Thanks @LaeriExNihilo! I forgot to mention that we also have ESLint. Please run npm run lint:fix to fix (hopefully) all linting errors.

Changed spaces to tabulations.
Alphabetically ordered what was missed.
@LaeriExNihilo
Copy link
Contributor Author

lint is complaining about a duplicate for my operators but I can't seem to find it. I fixed the spacing (that VSCode had by default to spaces instead of tabs) but I'm not sure it will fix it.

Fixed file for lint.
Build passes all tests and lint:ci locally.
@LaeriExNihilo
Copy link
Contributor Author

Locally this build passes all tests. lint fixed some alphabetical misorderings I hadn't seen.

@RunDevelopment RunDevelopment merged commit 2815f69 into PrismJS:master Jun 7, 2022
@RunDevelopment
Copy link
Member

Thank you for contributing @LaeriExNihilo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants