sveltex

Svelte + Markdown + LaTeX

MIT License

Downloads
223
Stars
4
Committers
2

Bot releases are visible (Hide)

sveltex - v0.4.1

Published by nvlang 3 months ago

Fixes

  • 6cc4dfb9c7e2b8177df6d790414e2d6658dc9231 Export metadata from SvelTeX pages even if no frontmatter was found on the page in question. In those cases, we'll just have

    <script context="module">
    export const metadata = undefined;
    </script>
    

    which is better than the alternative

    <script context="module">
    </script>
    

    because it won't cause import.meta.glob('...', { import: 'metadata', eager: true }) to throw an error if it reaches a SvelTeX page that doesn't have any frontmatter.


Full Changelog: https://github.com/nvlang/sveltex/compare/v0.4.0...v0.4.1

sveltex - v0.4.0

Published by nvlang 3 months ago

Features

  • Wrap variables defined in frontmatter inside a metadata object and export that from within a <script context="module"> block. This enables us to now use tools like Vite's import.meta.glob('...', { import: 'metadata', eager: true }) to e.g. help render a list of available routes with whatever metadata was defined.

Fixes

  • SvelTeX is now conscious of the fact that the script preprocessor might run twice on the same file, given that Svelte files may include one <script> tag and one <script context="module"> tag. Previously, doing this could lead to problematic behavior with SvelTeX, e.g., importing a component twice, causing an error.

Full Changelog: https://github.com/nvlang/sveltex/compare/v0.3.2...v0.4.0

sveltex - v0.3.2

Published by nvlang 3 months ago

Fixes

  • 9741f5eb1eff63c9695ea504892ba6d9414b8299 Reduce false positives of isImported function, which is used to decide whether a "registered" component should be auto-imported.

Full Changelog: https://github.com/nvlang/sveltex/compare/v0.3.1...v0.3.2

sveltex - v0.3.1

Published by nvlang 3 months ago

Fixes

  • 34493c3d83e4b6fe8611cfec9a81c4cd8218f70f Fix auto-importing of "registered" components by passing the correct variable to the detectAndImportComponents function. Also, don't try to import components that contain characters that wouldn't be allowed in a JS variable name.

Documentation

  • ac518e48f350c17541b5fc4dfdb4305aeb3f6d6f Mention in README that SvelTeX is an ESM-only package.
  • 384065469438ef48fae5a5f1c0c5cc23025d1d00 Add link to create-sveltex package in README.
  • db93a9dfecbdf42c45dc70c737c19f8d82425a81 Add Knip to list of cool software in README.

Full Changelog: https://github.com/nvlang/sveltex/compare/v0.3.0...v0.3.1

sveltex - v0.3.0

Published by nvlang 3 months ago

Features

  • Use sanitize-html to ensure that HTML generated by Markdown processor is valid.

  • Remove <p> tags within HTML elements or Svelte components that cannot contain paragraphs (e.g., <span><p>*text*</p></span> becomes <span><em>text</em></span> now, ignoring insignificant whitespace.

  • Add markdown.components option to SvelTeX configuration to specify preferences in regards to how each Svelte component is treated by SvelTeX when it comes to whitespace adjustments.

  • Auto-import components "registered" in the markdown.components array from the SvelTeX configuration if they are used in the markup and not already imported in the file's <script> tag.

    Note: a component is "registered" in the markdown.components array iff there exists an object obj in the markdown.components array such that all of the following hold:

    • obj.name equals the name of the component (case-sensitive).
    • obj.importPath is not undefined.
  • Add markdown.remarkRehypeOptions and markdown.rehypeStringifyOptions to SvelTeX configuration when the unified Markdown backend is used.

Fixes

  • Refine whitespace adjustment performed before passing markup to the Markdown processor.

Refactor

  • Change default value of SvelTeX configuration property markdown.directives.enabled from true to false.

Build

  • Update dependencies.

Documentation


Full Changelog: https://github.com/nvlang/sveltex/compare/v0.2.1...v0.3.0

sveltex - v0.2.1 Latest Release

Published by nvlang 3 months ago

Build

  • Update dependencies in deno.jsonc.
  • Refine selection of files to publish to JSR.
sveltex - v0.2.0

Published by nvlang 3 months ago

Features

  • 2585236cdd245fce5aef66fae84239539202c333 Pass original content to post-transformations.

    The use-case that motivated this was wanting to add a post-transformer to the code handler that would add a "Copy Code" button to the resulting code block; for this purpose, it's useful to have the original code (i.e., before any syntax highlighting) available to the transformer, so that it can e.g. pass said content to a prop of a Svelte "Copy Code" button.

Fixes

  • 8da499b559bfd37596a5ed145a3976b15315699a If the unified markdown backend is being used with retext plugins, messages emitted by said retext plugins weren't being logged to the console. This commit fixes this issue.
  • 91946bdd6ccb8d8cbb4d6fbeb74990262f5c54e4 Pass absolute file paths to the dependencies property of the object returned by the SvelTeX preprocessor. With relative paths, changes in the corresponding files weren't triggering HMR updates.

Documentation

  • 89591102ee265a9b55d1c03dd335788fb43871aa Fix mathjax install instructions in TSDoc comment.
  • b1ca18297125896fad4102c10d6f6de49787fa7b Mention create-sveltex in README.
  • 76be29a9ad567cc1dfe37be0569f8f8491408d3d Add plop to list of cool software that I didn't know before in README.

Refactoring

  • f045110a6faf9a09671bc48348d1fdcea63b1cf4 Import XRegExp from deps.ts instead of xregexp directly, in accordance with the centralized deps.ts design principle.

Chores

  • c6249a0ada795cd17e8260f0a90676822815a5e6 Simplify Vitest test script from package.json.
  • 7ac2ac8cb49a1b844883d9a045156d7635c22b0a Remove unused options from vitest.config.ts.
  • f411db625a79332c73a9f5f3f0840cf0d73ed837 Refine miscellaneous file glob patterns in configuration files (knip.json and tsconfig.check.json).

Build

  • 979d8422e7666c5305e0603b12ca1444022a6b1f Update dependencies, including some major updates for glob and rimraf (regular dependencies) and @vitest/coverage-v8, @vitest/ui, and vitest (dev dependencies).
  • 330d710d5531878097b8f7da80bc8010ec00dd21 Set "fixed" target in tsconfig.json (ES2018 instead of ESNext).
  • 22776a6685e2c5df37e369f47c1da236d612971a Remove some unused dev dependencies.

CI

  • 3af3c9ed580389f4f9e71111996786215499b26a Make pre-commit git hook lint codebase, instead of running unit tests. This makes the hook take somewhat less time.
  • 4339b61e62f6c3aa52d8a84d2c00912d873938d2 Remove action that bumped version strings and committed those changes automatically. Instead, we now set the version strings in both package.json and deno.jsonc to 0.0.0, and have the NPM resp. JSR publishing action bump the version within its local environment and publish a dirty branch, which is never actually committed. This simplifies the CI a bit, stops unsigned commits by GitHub Actions bot, and makes the existing discrepancy between tags and version strings in package.json and deno.jsonc less confusing (before, the version strings would always be just one release behind the tag; now, the version strings are always 0.0.0, which is, by virtue of being clearly intentional, arguably less confusing).
sveltex - v0.1.5

Published by nvlang 3 months ago

Build

  • Remove @types/mdast from peer dependencies, since the unified markdown backend doesn't need it.
  • Add remark-retext to (optional) peer dependencies, since the unified markdown backend needs it.

Documentation

  • Fix install instructions for Shiki code backend in TSDoc comment.
  • Add JSR score badge to readme.
  • Polish readme badges.
  • Add extra spacing above readme title SVG.
  • Remove extraneous keyword (marked) from package.json.
  • Add sveltex keyword to package.json.

Chores

  • Remove old, commented-out code.
sveltex - v0.1.4

Published by nvlang 4 months ago

Refactoring

Documentation

  • Polish main README.md.
sveltex - v0.1.3

Published by nvlang 4 months ago

Fixes

  • Don't remove comments while building.
sveltex - v0.1.2

Published by nvlang 4 months ago

Refactoring

  • Don't publish source maps.
  • Flatten dist directory structure (instead of having dist/src/mod.js as the entry point, we now have dist/mod.js) by setting rootDir in tsconfig.release.json to src.
  • Avoid redundancy and duplicate files in build output.
sveltex - v0.1.1

Published by nvlang 4 months ago

Fixes

  • Fix NPM publishing CI by building project before publishing.

Refactoring

  • Consistently import process from node:process (instead of using it as a global variable), to increase compatibility with Deno.

Documentation

  • Add TSDoc comments for every exported symbol.
  • Small changes to README.md.
sveltex - v0.1.0

Published by nvlang 4 months ago

Initial release.

sveltex - v0.1.0-beta.11

Published by nvlang 4 months ago

sveltex - v0.1.0-beta.10

Published by nvlang 4 months ago

sveltex - v0.1.0-beta.9

Published by nvlang 4 months ago

sveltex - v0.1.0-beta.8

Published by nvlang 4 months ago

sveltex - v0.1.0-beta.7

Published by nvlang 4 months ago

sveltex - v0.1.0-beta.6

Published by nvlang 4 months ago

sveltex - v0.1.0-beta.5

Published by nvlang 4 months ago

Package Rankings
Top 32.95% on Npmjs.org
Related Projects