Comments (2)
As I'm going through more of these, I'm trying to find a way to balance some SyntaxDefinition additions without making them be super-specific to the markdown mode. Basically, I want:
- A way to map all other SyntaxDefinitions
- Grab their filename recognitions to generate the fences.
I hate turning XML into an imperative thing, but "conceptually", I want something like this:
<modes>
<state id="CodeBlock-{mode.name}" usesymbolsfrommode="{mode.name}" useautocompletefrommode="{mode.name}" foldable="yes" scope="meta.block.{mode.name.toLowerCase()}">
<begin><regex>^```(?:([^\.]*.)?({mode.fileextensions.join("|")}|{mode.filinames.join("|")|{mode.name}|{mode.aliases.join("|")})</regex></begin>
<end><regex>```</regex></end>
<import mode = "{mode.name}" />
</state>
</modes>
Something like that. I'm basing the codefence recognition on GitHub's, which is in turn based on the rouge library. If we look at just ruby as an example, we see why we need to support a whole bunch of different "types" of things ( https://github.com/jneen/rouge/blob/master/lib/rouge/lexers/ruby.rb#L11 ):
file extensions:
'.rb',
'.ruby',
'.rbw',
'.rake',
'.gemspec',
'.podspec',
'.ru',
'.prawn',
'*.arb'
filenames:
'Rakefile',
'Guardfile',
'Gemfile',
'Capfile',
'Podfile',
'Vagrantfile',
'Berksfile',
'Dangerfile'
language names and aliases:
'ruby'
'rb' (handled by *.rb above already).
Anyways, just want to post current status. As I mentioned above, might be a good intermediate step to just have a build step inline all these modes and create the markdown mode. But eventually we want it to pick up on user's custom modes, and ideally do so live without restarting.
from subethaedit.
I'm closing this one with the merge of pull request #65 so it doesn't get lost in the Changelog. Please do file a fresh issue for further improvements.
Fixed in d9d2e93
from subethaedit.
Related Issues (20)
- make see tool cope with process subtitution
- DTD validation HOT 1
- Find in every window
- Extra newline inserted after replacement string HOT 2
- Respect system preference "Close windows when quitting app" HOT 2
- Add shebang support to syntax highlighting
- Show hex colors
- sh: /usr/bin/python: No such file or directory
- Double check all mode scripts against monterey and ventura HOT 2
- Remember tabs when restarting
- Incorrect Mastodon link on FAQ HOT 1
- #236 - Add SQL mode
- Add named pipe support to see
- Update python mode keywords
- Pretty Print JSON
- dart gradle kotlin support
- Welcome additions to SubEthaEdit
- Would it be possible to save the current highlight state?
- Line numbers are too small on big screens
- Is it possible to support the VIM mode in editor?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from subethaedit.