No release in over a year
== Rouge::Lexers::Wenyan {Rouge}[https://github.com/rouge-ruby/rouge] lexer for {Wenyan}[https://wy-lang.org/], programming language for the ancient Chinese.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.0, < 5.0
 Project Readme

rouge-lexers-wenyan

Rouge lexer for Wenyan, programming language for the ancient Chinese. Example

Installation

Add this line to your Gemfile:

gem 'rouge-lexers-wenyan'

Or run:

$ gem install rouge-lexers-wenyan

Usage

For Jekyll:

{% highlight wenyan %}
吾有一言。曰「「問天地好在」」。書之。
{% endhighlight %}

or use fenced code blocks in Markdown / Kramdown:

```wenyan
吾有一言。曰「「問天地好在」」。書之。
```

For Rouge CLI:

$ 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, 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.