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

Add new preprocessor macro #32

Merged
merged 5 commits into from
Oct 13, 2017
Merged

Add new preprocessor macro #32

merged 5 commits into from
Oct 13, 2017

Conversation

okkez
Copy link
Member

@okkez okkez commented Sep 26, 2017

No description provided.

    #@SampleCode description of samplecode
    puts "Hello, World!"
    #@EnD

will preprocess to

    //emlist[description of samplecode][ruby]{
    puts "Hello, World!"
    //}
We use this notation via preprocessor macro `#@SampleCode caption`
@okkez
Copy link
Member Author

okkez commented Sep 26, 2017

なんとなく動くのができた。
既存のソースが全部処理できるのは確認済み。

#@samplecode 例: はろーわーるどのサンプルコード
puts "Hello, World!"
#@end

↑がこうなって、

//emlist[例: はろーわーるどのサンプルコード][ruby]{
puts "Hello, World!"
//}

こうなります。

<p>例: はろーわーるどのサンプルコード</p>
<pre>
puts "Hello, World!"
</pre>

プリプロセッサマクロで書いておくと、ソースコードを自動抽出して自動実行&テストできるようにしたい。
直接 //emlist[caption][lang]{ の形式で書くことはない想定。

💭 syntax highlight はrdocのやつを使えば、追加のライブラリーなしでできるような気がしている。どうせRuby専用なので、外部のライブラリーを使うまでもなさそうという認識。

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

1 participant