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

sTeX folding mode #4498

Closed
wants to merge 1 commit into from
Closed

sTeX folding mode #4498

wants to merge 1 commit into from

Conversation

edemaine
Copy link
Contributor

CodeMirror's fold mode is awesome! There are built-in folding modules for code, braces, Markdown, XML/HTML, but not for sTeX. (For comparison, Ace supports all of these.) This PR fills this hole by providing folding support in sTeX/LaTeX.

Conveniently, @williamstein already wrote this code; I'm just putting this together into a PR (and converting from CoffeeScript to JavaScript). See sagemathinc/cocalc#1509 which requests that I do this.

I'm new to the CodeMirror source so let me know if I missed anything. In addition to the new fold module, I added to the obvious demo.

@marijnh
Copy link
Member

marijnh commented Feb 6, 2017

Hi. Thanks for the PR. But to keep the main distribution maintainable by a small team, we're tightening the criteria for what goes into the main distribution, and are encouraging people to maintain code like this in separate NPM modules. (We will, eventually, also split the current main package into smaller modules.) So it'd be great if you could put this into a separate repository and publish it to NPM. It's not in scope for the main distribution.

@marijnh marijnh closed this Feb 6, 2017
@edemaine
Copy link
Contributor Author

edemaine commented Feb 6, 2017

OK. Do you have a suggested naming for the NPM package, e.g. codemirror-stex-folding? Or would you prefer a more "contributed" namespace?

@marijnh
Copy link
Member

marijnh commented Feb 6, 2017

I'd go with codemirror-fold-stex, so that other folding modules can share the codemirror-fold- prefix.

@edemaine
Copy link
Contributor Author

edemaine commented Feb 6, 2017

Ah yes, that is better. FWIW, markdown-it could be a good model here, which has several self-owned plug-ins and several contributed plug-ins, including links to the latter. In any case, I'll keep you posted about an NPM module in case you want to assemble a list of links somewhere.

@adrianheine
Copy link
Contributor

We already have a list which definitely could be improved.

@edemaine
Copy link
Contributor Author

edemaine commented Feb 6, 2017

Cool, thanks! I'll just add to that Wiki once I get around to packaging (maybe making a section for fold-related plugins).

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

Successfully merging this pull request may close these issues.

None yet

3 participants