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 Muse support to GitHub and GitLab #55

Open
link2xt opened this issue Oct 3, 2019 · 11 comments
Open

Add Muse support to GitHub and GitLab #55

link2xt opened this issue Oct 3, 2019 · 11 comments

Comments

@link2xt
Copy link
Contributor

link2xt commented Oct 3, 2019

GitHub and GitLab support various markups via their libraries:

The parser is not required to be in Ruby. reStructuredText is supported with Python and Pod is supported with Perl.

Since their Dockerfile already uses cpanm, there is a chance that addition of Text::Amuse will be accepted. Maybe it makes sense to revive currently deprecated muse-quick.pl with some basic HTML output support so we don't have to install the whole Text::Amuse::Compile.

Amusewiki is git-based, so adding Muse support will make it possible to preview site repositories, such as https://github.com/melmothx/amusewiki-site, directly on GitHub.

@melmothx
Copy link
Owner

melmothx commented Oct 5, 2019

@link2xt did you look at their code? do the need an executable for rendering? Converting the muse-quick.pl to a stripped down HTML output sounds trivial to do, but what exactly should produce?

@link2xt
Copy link
Contributor Author

link2xt commented Oct 5, 2019

All that is needed it seems is to add a wrapper to lib/github/commands and a line that calls it to the end of the https://github.com/github/markup/blob/master/lib/github/markups.rb, which already contains examples for pod6, pod and ReST.

A command pod2html is very simple and is located here:
https://github.com/github/markup/blob/master/lib/github/commands/pod2html

Here is how it works:

./pod2html <<EOF
=pod

=head1 Title

Foo bar

=cut
EOF
<h1 id="Title">Title</h1>

<p>Foo bar</p>

I'll try to produce similar muse2html, if it is small enough maybe it can just be placed directly into the markup repo and there is no need to modify Text::Amuse.

@melmothx
Copy link
Owner

melmothx commented Oct 5, 2019 via email

@link2xt
Copy link
Contributor Author

link2xt commented Oct 5, 2019

I have created a branch here: https://github.com/link2xt/markup/tree/muse

@melmothx

I have no problems refactoring muse-quick.pl to do that. Please let me know if you want to try yourself or you want me to do that. I'm happy to review your work or do it myself anyway.

muse2html wrapper is there, I have added it to muse branch. Also need to modify Dockerfile and maybe something else like script/bootstrap. Review is welcome.

In commit message I tried to make it clear that Muse is a markup with history and multiple implementations.

I am going to check what is needed to make CI pass and submit a draft PR to upstream.

@link2xt
Copy link
Contributor Author

link2xt commented Oct 5, 2019

CI fails now: https://travis-ci.org/link2xt/markup/jobs/593929253

Need to add Muse to GitHub linguist first.

@melmothx
Copy link
Owner

melmothx commented Oct 5, 2019 via email

@link2xt
Copy link
Contributor Author

link2xt commented Oct 5, 2019

And to add Muse to Linguist, we need a TextMate grammar. Good thing is that it can be used by Atom, so we'll automatically fix melmothx/amusewiki#176

Going to try to make some basic TextMate Muse grammar then.

@melmothx
Copy link
Owner

melmothx commented Oct 5, 2019

Doesn't seem like a trivial task though...

@link2xt
Copy link
Contributor Author

link2xt commented Oct 5, 2019

On the other hand it seems like there are many markups that don't have a TM grammar even though contributing guide says there should be one.

I'll see how hard it is to do some basic highlighting, like directives, headings and emphasis anyway.

@link2xt
Copy link
Contributor Author

link2xt commented Oct 5, 2019

I have created an Atom package, see my comment for AmuseWiki issue. The grammar is far from finished though, it does not even highlight nested inline markup properly, so I am going to try to add Muse to linguist without the grammar.

@link2xt
Copy link
Contributor Author

link2xt commented Oct 11, 2019

Muse is added to GitHub linguist without any TextMate grammar. Waiting for release now, then will try to make CI for markup pass again.

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

No branches or pull requests

2 participants