Giter Club home page Giter Club logo

mystmd's Introduction

MyST Markdown Command Line Interface, mystmd

MIT License CI Discord Chat

mystmd is a set of open-source, community-driven tools designed for scientific communication, including a powerful authoring framework that supports blogs, online books, scientific papers, reports and journals articles.

Note

The mystmd project is in beta. It is being used to explore a full MyST implementation and will change significantly and rapidly. The project is being developed by a small team of people on the Executable Books Project, and may make rapid decisions without fully public/inclusive discussion. We will continue to update this documentation as the project stabilizes.

Overview

The mystmd project provides a command line tool (mystmd) for working with MyST Markdown projects.

  • Provides functionality for cross-referencing, external structured links, and scientific citations
  • Translate and render MyST Markdown into:
    • HTML for static websites, and modern React for interactive websites (like this website!)
    • PDFs and LaTeX documents, with specific templates for over 400 journals
    • Microsoft Word export
  • Parse MyST into a standardized AST, that follows the MyST Markdown Spec

See the documentation.

Get Started

Ensure that you have an updated version of Node installed (https://nodejs.org/):

node -v
>> v20.4.0

The MyST Markdown CLI is available through NPM, PyPI and Conda:

# Using npm, yarn, or pnpm
npm install -g mystmd
# Or using PyPI
pip install mystmd
# Or using Conda / Mamba
conda install mystmd -c conda-forge

Usage:

myst init
myst start
myst build my-doc.md --tex

Development

See the Contribution Guide for information on setting up a development environment.


As of v1.0.0 this package is ESM only.


mystmd's People

Contributors

agoose77 avatar andry-tino avatar brownsarahm avatar carreau avatar choldgraf avatar dependabot[bot] avatar dylangrandmont avatar fwkoch avatar github-actions[bot] avatar gyhhaha avatar jborrow avatar jbusecke avatar kianmeng avatar kolibril13 avatar lecrisut avatar lwasser avatar mriduls avatar parmentelat avatar psychemedia avatar rgaiacs avatar roaldarbol avatar rowanc1 avatar ryanlovett avatar sglyon avatar sinanbekar avatar stevejpurves avatar tavin avatar thadguidry avatar williamstein avatar yxwww avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mystmd's Issues

Add a demo page

The JS markdown-it package has a nice syntax demo page that comes with some pre-defined syntax and also lets you update the syntax manually to see how it behaves. I think it'd be useful if we had a simple page like this once we have the JS parser/renderer in good shape.

cc @rowanc1 who I believe showed off something like this a few months ago πŸ€”πŸ€”

Export MarkdownIt plugins

I'm not a TS expert by any means, so please pick me up on things if I've missed something.

jupyterlab-markup implements a plugin system that simply provides a JupyterLab-extension point for MarkdownIt plugins. Currently markdown-it-myst creates the MarkdownIt renderer internally, and does not export the plugins for consumption by third-party packages.

https://github.com/executablebooks/markdown-it-myst/blob/2c186568e645a8cb15051e7a35230dfc1b949aa7/src/index.ts#L20-L29

Would you be able to make these public so that I can wrap them in https://github.com/agoose77/jupyterlab-myst?

Repository Evolution

Background

Over the past few months we have slowly started pulling repositories out of this repository into adjacent repos, this repository originally had the goal of being what has now become markdown-it-docutils and the majority of the code has now been duplicated (with the exception of state management) and improved (e.g. recursive directive parsing). That repository now has the core directives and roles that support the myst spec, and there have been other repositories that support some aspects of math parsing, and other requirements to support myst (e.g. block breaks, comments, etc.).

Repository Responsibilities

In discussion with @chrisjsewell and @fwkoch today, we are planning to change this repo into a container repository that has the following responsibilities:

  • parse MyST into a AST. To start with this will be markdown-it token streams, but will be more formalized into mdast over time.
  • serialize AST into a default HTML tokens
  • expose an opinionated set of markdown-it plugins (e.g. that can be used in jupyterlab-myst, myst-vs-code, etc.)
  • directly expose functionality to add new roles/directives that will be passed into docutils, as well as any other markdown-it plugins to add
  • Handle cross-reference management through a plugin system. This will expose the ability to do cross-document reference resolution, but that is not a direct responsibility of this library.

In parallel to this @chrisjsewell and @fwkoch are looking into standardizing testing and serialization into a mdast spec, which will likely form the basis of many unit tests for "myst as a spec" that can be implemented in many different libraries/languages. Initial experimentation on this is happening in https://github.com/chrisjsewell/myst-spec and curvenote/schema#44.

Naming repositories

As a part of this, we discussed the fact that neither markdown-it-docutils nor markdown-it-myst were good names:

  1. markdown-it-docutils is not actually doing the responsibility of docutils in python, which has a much wider scope. The scope of that repository is strictly parsing (using markdown-it) roles and directives. The base directives are those used in docutils/sphinx and likely common extensions to the jupyterbook ecosystem.
  2. markdown-it-myst should be able to switch out the dependence on markdown-it and have no changes to the public interface (e.g. moving to https://unifiedjs.com/, which has more uptake in the MDX community etc.).

We discussed in our meeting today that we could live with (1) for now (another option thought of later is below); and (2) we should change the repository name to mystjs. myst is taken, and this nicely does not confuse it with the python implementation.

Repository Dependencies:

Notes

Note that given the name change of this repository (markdown-it-myst --> mystjs), we could move markdown-it-docutils --> markdown-it-myst, and incorporate the myst-extras pieces in there rather than having to maintain another repo/version/release etc. I personally think this makes a lot of sense, and this repository would have all the components to parse myst-specific things. It would not have things like math, footnotes, etc. which are implemented elsewhere.

@chrisjsewell and @fwkoch I am interested in your thoughts here! Personally I think this would be clearer all around and not had a tiny repo to do the extras.

Next Steps

  • Closes #32
  • finish merge of #35 to move to the above packages
  • rename this repository and package.json to mystjs
  • deprecate markdown-it-myst on npm OR rename docutils, bring in the myst-extras and rename the result to markdown-it-myst (see notes)
  • Continue to add tests, standardize on mdast (likely) and get another repo together that is the myst-spec, such as it exists today.
  • Figure out reference database and extension points
  • Decide on role syntax!

A picture of the discussion!

image

Improve templating for docx export from myst-cli

Context

  • myst-cli has introduced functionality to export myst files as tex/pdf/docx from the command line
  • tex/pdf exports allow you to specify a latex template to customize the output. There are already a number of templates available: https://github.com/myst-templates. These are totally standalone, with a template.yml config (defining template metadata, required frontmatter fields, and additional template options), a nunjuks-style template to use, and all additional supplementary files (icons, latex document classes, etc).
  • jtex validates user input against the template options and fills in the template based on these options, myst frontmatter, and tex content (converted with myst-to-tex)
  • docx templating, however, requires passing in a renderer function (since we use docx to generate the document). It can take additional template options (and these can be defined in a template.yml file), but there is nothing like jtex validating these options and holding it all together.
  • Additionally, there is no easy way to define additional static files required by the renderer...

Proposal

  • I don't think we should move away from using the docx library for now. This would require writing valid docx nunjuks-style templates in XML, doesn't feel great, but certainly a future possibility.
  • For now it would be great to at least:
    • validate options based on a template.yml
    • bundle static files together with the template.yml
    • connect this template to the renderer function so they are used together
  • This means teasing apart the template download / validation part of jtex from the tex-specific rendering, and updating the docx build to consume a template package using the non-tex part of jtex.

Tasks and updates

No response

Place header anchors to the right of the header instead of the left

Context

Currently our header anchors are to the left of the header. They exist in the "within-page left margin". However, this means that in some cases the anchor overlaps with other UI elements like the primary sidebar scrollbar:

For example:

chrome_LmVEEQH3Ps

As an anecdote, I've also found that it is tricky to get the UX right when putting things in the "in between" spaces of the page, and have instead opted to try and make UI elements flow with the content when possible.

Proposal

I'd suggest we move header anchors to the right of the headers rather than be to the left. They'd flow with the header content so we'd know they will always be visible on the page.

Tasks and updates

No response

Create Typescript Autodocs

Leaving a few notes here on how to create typescript auto documentation:

npx typedoc src/index.ts --plugin typedoc-plugin-markdown --out docs
npx typedoc src/index.ts --json temp.json

With these commands you can create typescript docs that are pretty solid. I think that we could improve it slightly and change the plugin to work with myst markdown, e.g. fewer headings.

The documentation looks pretty solid though!

Implement Syntax/Roles/Directives Running list

Note: Some of these do not need to have their own regexes written, we can use markdown-it extensions if they already exist.

Syntax extensions

  • Math - \begin{equation} See also #4 (myst_amsmath_enable) and executablebooks/MyST-Parser#202
  • Table
  • Footnote
  • Admonition alternat : syntax
  • Definition list
  • myst_html_img_enable see here
  • Front matter blocks

Directives

  • Math directive with options
  • list-table
  • images directive with options
  • Bibliography directive ({bibliography})
  • Code block directives ({code-block})

Roles

  • abbr, sup, sub
  • Cite - {cite}
  • term

Functionality

  • Code syntax highlighting

SHAME

we need to call the emoji police

chrome_2020-07-23_14-05-40

jtex: Allow for nested files structure

Context

Hey, I would like to extract the individual issues discussed in kai-tub/latex-beamer-pure-minimalistic#75 for clarity and easier communication.

As discussed in the thread, I am more than happy to try to give my template first-class support for mystjs/jtex.
As part of the first trial, I would strongly prefer not to be forced to have a flat file hierarchy when creating the template.
My workflow would be as follows:

  • Create the template.tex and template.yml files at the root of my template repository
  • Create a git submodule of my actual beamter repository, as this guarantees to have the source fixed and keep the myst-interface separate from the beamer template itself

My reasoning is as follows:

  • My CI/CD pipeline for the beamer presentation would have to be updated to exclude changes to the template.tex to trigger updates/releases/tests and I don't think that this is helpful because the repository contains the theme and I think a template for something other users aren't interested in using, just adds noise and additional complexity that isn't necessary
  • I am the maintainer of the beamer presentation theme and would also be the maintainer of the template, but I don't think that it is reasonable to assume that this will be the case for all other nice-looking beamer themes.
    • Of course, one can always fork the original theme and inject the template code and maintain that separately but it would duplicate code that could easily become out-of-sync and produce confusing results, as using the theme "directly" might produce different outputs than the template itself if the sources are different
    • This would also happen with my suggestion, but then it would be clear that the template just needs to point to the newest commit of the theme
  • It makes it easier to keep separate changelogs/releases for both components
    • If I update the theme interface to support more options, I would need an additional way of communicating these changes only to the template users
  • Last practical reason: In my theme, I 'utilize' folders to keep logos in a separate directory. So I would already need support for folders to correctly render my template. This would also be a change I wouldn't be happy to do, because it adds noise to the folder structure and might be confusing for future template creators

Proposal

Allow the template.tex and template.yml files to be in a separate directory from the other theme components.
Allow files to be in separate directories to not restrict the 'expected' structure of themes.

Please let me know if I should further clarify my points :)

Tasks and updates

No response

Fix remaining commonmark tests

Current failing cmark json tests:

// Expected
44, // This is a block break, expect it to be different
// Minor
25, // This is a   I think
// To fix
333, // Spacing around inline code?
353, // Broken paragraph/emph?
506, // This is a link issue?

Initial spin out of package

I am working on spinning out the package. I have put together a simple demo, should be able yarn install; yarn start to play around with it.

myst-demo

I will continue to work here probably for the next week or so, then hopefully it will begin to mature.

cc @chrisjsewell or @choldgraf

Roles with data / parameters

I am wondering what the best way to add roles that have multiple attributes that need to be set, but no content. For example, creating a simple example for reactive document like (variables, displays and sliders):

image

# Hello World

```{variable}
:name: x
:value: 2
```

The value of x is {display}`value:x format:.1f`.

{range}`value:x min:0 max:10`

I am looking to suggest a format for the internals of a role, which I don't think are suggested at all by MyST.

Something like: attribute:value attribute2:value2?

I think the only overlap in functionality would be the glue role, but I don't think it has any arguments at the moment?

Provide a visual cue when something has a "preview" for hover/click

Context

Right now there are multiple ways that a hover preview can show up:

By hovering over a "normal" looking link:

chrome_iJNjwz40TW

By explicitly clicking a link with some dotted underline:

chrome_j4G1BEbWDS

It is a bit confusing to have different kinds of behaviors and visual styles for the "hover preview" behavior, so I suggest that we provide some standards for extensions to follow.

Proposal

We should define a default behavior for both:

  • The visual style that indicates something is an "enriched reference" and not just a hyperlink
  • We should define the behavior that is consistent across all enriched references (e.g. is it always click? hover? hover w/ delay?)

Tasks and updates

No response

myst css is not included in the package

Describe the bug

context
When I try and use the mystjs renderer, I am unable to apply the default styles

expectation
I expected to be able to load the CSS in a typescript app

bug
But instead there are no CSS files

Reproduce the bug

import the latest myst from npm

List your environment

No response

Document all of the syntax that markdown-it-myst supports

Once we have some documentation, we should make sure there's a reference page that defines all of the syntax that is supported in markdown-it-myst. This could be generated programmatically (maybe from test infrastructure or something?) to make sure it is up to date.

Improve compatibility with windows (e.g. can't init)

Describe the bug

context
When I run myst init, I get an error message:

$ myst init
SyntaxError: Invalid regular expression: /c:\LocalTemp\Repos\Local\MystTest\/: \ at end of pattern

problem
I realize this project is still in beta, but it looks awesome. I'm a big JupyterBook user and love this idea. Maybe my bug is specific to Windows?

Reproduce the bug

run myst init from Windows command line. Same error in Powershell and Git Bash as well. Also tried manually typing in the path.

List your environment

node 18.12.1
Windows 10

Allow multiple templates for MyST websites

Problem

Currently there is only a single site template for mystjs, which is currently the curvenote book-theme. We want to generalize and upstream that template (or most parts of it at least), and allow for multiple different templates to exist.

This work should ideally support the "template-er" to be written in any language (e.g. python or javascript), which works on a structured data directory with all assets needed. The tempalte-er can then take that structured data and create a website (e.g. static html, or a more complex application like the current themes that use remix to serve/transform the data on the fly).

Goals

  • Get the base remix theme over to executablebooks, these will be opinionated and can be used in react components for other remix themes (maybe generalizing parts to support any react themes, e.g. nextjs)
  • Have an initial theme in EBP that follows the JupyterBook theme
  • Use and extend the template.yml syntax developed for static exports to create structured data
  • Allow the exports to be picked up in the static site folder, so we can download PDFs etc from the site
  • Consider and study the current Sphinx templates to see if we can use that template ecosystem easily (or design it in a way that we can pull on it in the future, including all sorts of design extensions).

Considerations

The current SiteConfig has all sorts of design pieces in it at the moment that are defined centrally (currently in @curvenote/site-common), these should instead be defined by the template.yml (e.g. hide_header_block or analytics). I think we can suggest some base things or naming conventions, and/or provide ways in the future to inherit these (mixins), but all of the template data/customizations should be defined in the template. However, because these are structured, they can still be validated by myst, which means nice error messages, etc. when using the CLI.

Creating a template server

The template should define how to start the service on the command line (e.g. npm run start) which should provide a watch task. MyST will providing the content server (serves structured JSON) and a socket on that server that pushes information about when to reload/rebuild the site. Other than those two constraints, I don't think there is too much else we are putting on the template server/process, which should leave things wide open for many different templates.

cc-ing @echarles @choldgraf who were interested as @fwkoch and I start to move forward on this in the next few weeks. Would love any questions/thoughts to prompt more of our thinking into the open. πŸš€

Full support for beamer from `myst build` command-line interface

Describe the bug

Hey, it is me again πŸ˜…

I am not sure if you even currently support the Beamer template rendering, so please close this issue if this is still WIP.
I am working on creating the template repository for my beamer theme at:

But the code from the documentation doesn't produce the expected output for beamer:

https://www.myst.tools/docs/jtex/create-a-beamer-template

You can find my example code here:

with the build artifact here:

that includes the following tex output:

% Created with jtex v.0.0.8
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copy in your template with your latex document!

\documentclass[aspectratio=169,]{beamer}

% https://tex.stackexchange.com/questions/123700/how-to-use-local-beamer-theme-in-project-source-folder
% \usetheme won't work if loading from nested directory!

\usepackage[utf8]{inputenc}
\usepackage[darkmode,noto,]{latex-beamer-pure-minimalistic/beamerthemepureminimalistic}

\title{My Beamer Template}
\author{%
  }
% \institute{[doc.institute]}
% \newdate{articleDate}{26}{11}{2022}
% \date{\displaydate{articleDate}}

\begin{document}
\maketitle

\begin{frame}{Outline}
  \tableofcontents
\end{frame}

\section*{Introduction}

\subsection*{Background}

\subsubsection*{My Background Slide Title}

This is some background on beamer templates, use a combination:

\begin{itemize}
\item of \texttt{myst-to-tex} for conversion; and
\item \texttt{jtex} for templating.
\end{itemize}

\end{document}

which doesn't include the begin{frame} environment.

Do I have to modify my template.yml file in any way to indicate that it is a beamer template?
Or should the parsing 'understand' that it is a beamer environment as soon as it sees at least one block with a `+++ {outline: true}``` block?

Thanks!

PS: CI doesn't include latexmk yet in my build pipeline, so ignore the missing pdf file πŸ˜…

Reproduce the bug

See https://github.com/kai-tub/latex_beamer_pure_minimalistic_mystjs/blob/main/.github/workflows/jtex.yml

List your environment

No response

Remove dependence on `@curvenote/blocks`

There is a lingering dependency on @curvenote/blocks for type definitions around notebooks.

These should be moved out of myst and into the base dependencies.

This currently causes problems with myst-frontmatter, which is always a step behind:

image

Support richer affiliations

Currently we only support a string in frontmatter. This should be improved to support sharing affiliations between authors, and adding additional information like country, address, ROR id etc.

Better explanation of how to render math?

Describe the problem/need and solution

Context
I am trying to use this library to create files using markdown that allow me to refer back to equations. I would like to achieve something like this example

Problem / Idea
For some reason, I can't do both reference to equations work and render equations. For example, I would like to be able to show the letter lambda in the example bellow:

image

I have looked the documentation up and down, but even the examples available in the documentation don't render like LaTeX! I have tried using the interactive part of the documentation (which is a great feature) and I does not render there as well!

I am quite new to javascript, so maybe it is obvious for everyone else? In this case, I apologize. If I understood some of the code, there seems to be some options for the MyST() which do not seem to be documented anywhere. Maybe the solution is in there and this is the real issue?

Thanks!

Guide for implementation

No response

Tasks and updates

No response

Clarify that this is pre-alpha software

Context

For now, we do not want to make any public commitments about the specific structure, spec, features, etc of this repository. We are using it to explore what a myst implementation in js might look like, but there isn't a clear message to others about the "development state" of the repository. This might lead to confusion about what to expect.

Proposal

We should put banners in the mystjs documentation and README that make it clear what state the project is in. I suggest something like:

Note Unstable codebase!
This project is in a pre-alpha state. It is being used to explore a MyST implementation in JavaScript, but will likely change significantly and rapidly. It is being developed by a small team of people on the Executable Books Project, and may make rapid decisions without inclusive discussion. We will update this documentation when the state of the project has stabilized.

Tasks and updates

No response

How should we deal with math options/rendering/html?

I think there are a couple things to think about:

  • Using markdown-it-texmath has a soft dependency on katex which I am pretty sure we do not want to bundle
    • Is the output the raw latex? Or should we have an option to actually put out the katex output (only requiring css)
    • My instinct at this stage is to leave it as latex (not rendered), similar to jupyter book at the moment
      • Note that this is different than the code, which is pre-parsed.
  • We will have to have some defaults on what the math in markdown is configured as ($, \( \[, etc.)
    • I think the default is $..$, but overrides possible in options
  • What is the html wrapper for math?

HTML Wrappers:

I think in JupyterBook/sphinx currently this is done:

Without a label:

<div class="math notranslate nohighlight">\[
\int_0^\infty \frac{x^3}{e^x-1},dx = \frac{\pi^4}{15}
\]</div>

With labels:

<div class="math notranslate nohighlight" id="equation-eqn-best">
<span class="eqno">(2)<a class="headerlink" href="#equation-eqn-best" title="Permalink to this equation">ΒΆ</a></span>\[
e = mc^2
\]</div>

And inline:

<span class="math notranslate nohighlight">\(x_{hey}=it+is^{math}\)</span>

Where is api.myst.tools maintained?

Currently, https://api.myst.tools/templates/site shows 1 entry book-theme. I am trying to change the template to render the docs with the following entry in the frontmatter of myst.yml, and it fails with Problem with template link "https://api.myst.tools/templates/site/myst/myst-tools-theme": 404 Not Found

...
site:
  template: myst-tools-theme
...

Does that mean that the online https://api.myst.tools/ needs to be updated to enroll a new template. This would sound a bit overkill and not flexible enough.

My more general question would be: how can I use another template/theme like myst-tools-theme?

markdown-it options as parameters instead of a hardcode

I wanted to render an md file containing html tags, but they weren't parsed and they were displayed as paragraph content. Then I saw this part in your src/index.ts:

export default function MyST() {
  const tokenizer = MarkdownIt('commonmark', { html: false });
  //...

I think that MarkdownIt options should be options to MyST as well. Especially that this behavior is inconsistent with the Python parser - running default_parser for html parses html tags normally.

Write developer documentation

Once the codebase has settled down a bit, we should write developer documentation for markdown-it-myst so that others on the team can get started. Once it has progressed even further, we should also get this documentation ready for the outside world so that others can pitch in as well!

Support for colon fences

Context

A lot of the existing jupyter book content has these, and is not rendered using mystjs.

Proposal

Looking forward to knowing more about where in the current tools we can implement this. I think it might be in the docutils library?

Tasks and updates

No response

Check for nodejs 16 or 18 and raise a helpful error message if not found

I tried following the installation instructions and got a weird error when running any myst commands. I looked deeper and realized it was because I was running nodejs 14. The installing prerequisites section explained that I needed node 16+, but because it came after the "install myst" section, I missed it.

I'd suggest either:

  1. Check for the nodejs version and raise an error w/ a helpful message, rather than waiting for node to choke.
  2. Moving the installation pre-requisites before the "install myst" section

Lift equations out of paragraphs

Generally displayed math is not inside of a paragraph, the exception I have found is inside bullet lists and tables. Because these nodes are a div, they are being rendered inside of a paragraph -- which is not correct HTML. This throws exceptions in React, it works, but causes a client-side re-render, which flickers. :(

image

This should be a basic myst-transform.

Images: LaTeX has UNIX paths always

Right now, the DOHMeg040aVXqR51yjBy below is interpreted as a command, this should be fixed to unix paths similar to web outputs.

\includegraphics[width=0.7\linewidth]{images\DOHMeg040aVXqR51yjBy-a444210719e70b2f4892f220b4c52010.png}

See #115

Support Search in MyST Sites

Search is currently not enabled in mystjs sites, but certainly something we want!

A few options:

It would be nice for offline/local search to work, so this is likely plug-able, and can be taken over by the theme, deployment or site config.

References

Decide on scope and major functionality of this repository

I think there are a few different visions for the scope and functionality for markdown-it-myst. We should align on these high-level questions to make sure that we have the same goals in mind for development.

@rowanc1's initial implementation here seems focused on mimicking the MyST Parser in Python (at least in terms of functionality). It focuses on "parsing to tokens and rendering to HTML using markdown-it", but doesn't have any notion of a multi-document model. In @chrisjsewell's PR he lays out a more fully-functional picture for bringing in the same functionality as Sphinx and Jupyter Book, rather than just the MyST parser.

It feels like these two approaches have different implications for how much complexity and maintenance burden we are taking on, as well as how this tool fits in with other potential tools in the ecosystem, so we should make sure we are on the same page about this.

Can we use this issue to agree on a strategy for how we're going to tackle "MyST in Javascript", and what scope this repository should have? I'd be interested in hearing @chrisjsewell and @rowanc1's thoughts on this.

🧹 Prevent new folder creation on `myst clean`

The webObjectFileFactory aggressively copies notebook outputs to files very early in the processing stage (i.e. when going from notebook file to pre-processed mdast). This is opposed to markdown processing where everything is kept in memory at that stage.

This only becomes apparent when running myst clean: markdown and notebook files are processed to read frontmatter and find all the exports which need cleaning. Just in doing that the _build/site/public/_static folder is created and some notebook files are copied over...

Likely the solution to this is modifying the webObjectFileFactory, maybe aligning more with how markdown files are processed? or maybe just making the file copying happen a bit later?

Document colonFences

Context

Colon fences aren't supported out of the box, but it seems that they are supported some way or another:

https://github.com/executablebooks/mystjs/blob/4a6822d6b4190ce1927c138c85735b1da4b8be30/packages/mystjs/tests/colonFences.spec.ts#L3

However I couldn't see any mention of colon fences in the docs, or extensions in general.

Proposal

As a start, perhaps we could:

  1. Add a section about MyST extensions and how to activate them in myst.js
  2. Document how to activate colonFences as the first extension to show off.

Tasks and updates

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.