Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgck81lnn/rouge-lexers-wenyan
Rouge 代码高亮库文言lang支持 Rouge lexer for Wenyan, programming language for the ancient Chinese
https://github.com/dgck81lnn/rouge-lexers-wenyan
rouge rouge-lexer syntax-highlighting wenyan wenyan-lang wenyan-programming-language
Last synced: 6 days ago
JSON representation
Rouge 代码高亮库文言lang支持 Rouge lexer for Wenyan, programming language for the ancient Chinese
- Host: GitHub
- URL: https://github.com/dgck81lnn/rouge-lexers-wenyan
- Owner: DGCK81LNN
- License: mit
- Created: 2022-12-11T15:11:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-23T07:38:35.000Z (8 months ago)
- Last Synced: 2024-03-23T08:32:05.516Z (8 months ago)
- Topics: rouge, rouge-lexer, syntax-highlighting, wenyan, wenyan-lang, wenyan-programming-language
- Language: Ruby
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rouge-lexers-wenyan
[Rouge] lexer for [Wenyan], programming language for the ancient Chinese. [Example]
[Rouge]: https://github.com/rouge-ruby/rouge
[Wenyan]: https://wy-lang.org/
[Example]: https://dgck81lnn.github.io/blog/posts/220906_wenyan_stdin_examples## Installation
Add this line to your Gemfile:
~~~ruby
gem 'rouge-lexers-wenyan'
~~~Or run:
~~~sh
$ gem install rouge-lexers-wenyan
~~~## Usage
For [Jekyll]:
~~~liquid
{% highlight wenyan %}
吾有一言。曰「「問天地好在」」。書之。
{% endhighlight %}
~~~or use fenced code blocks in Markdown / [Kramdown]:
~~~markdown
```wenyan
吾有一言。曰「「問天地好在」」。書之。
```
~~~[Jekyll]: https://github.com/jekyll/jekyll
[Kramdown]: https://github.com/gettalong/kramdownFor Rouge CLI:
~~~sh
$ rougify highlight -r rouge-lexers-wenyan [...]
~~~Besides `wenyan`, this lexer also supports `wy` and `文言` as aliases. `.wy`, `.文言`, `.經`, `.篇`, `.章` and `.書` are valid file extensions for Wenyan.
## Features
* Supports latest grammar (as of 2022)
* Highlights JavaScript expressions in “identifiers”
* Consistent with compiler behavior
* namely, it handles quotation marks the same way as the compiler does
* except for the [`注曰*/` hack](https://github.com/akira-cn/script-wy/blob/master/%E5%BA%8F.wy), which is too evil to support
## Testing
After cloning the repository, run `bundle exec rake` to run the test *(not “tests” as there is literally only one test, lmao)*, or run `ruby bin/visual.rb` (optionally followed by a theme name which defaults to `thankful_eyes`) to write a visual test to `tmp/visual.html`.