Forum: Meta: Markdown in Biostars (now enabled)
23
gravatar for RamRS
4.7 years ago by
RamRS24k
Houston, TX
RamRS24k wrote:

I am sure most of us that use GitHub love its text editor. Would it even be remotely possible for Biostars to add github flavored markdown in its text area, for editing posts/answers/comments? Would it be welcomed by the community here?

If it's OK with Istvan, I can definitely help with this task.

documentation forum markdown meta • 2.9k views
ADD COMMENTlink modified 3.5 years ago by Michael Dondrup46k • written 4.7 years ago by RamRS24k

Put me down as in favor!

ADD REPLYlink written 4.7 years ago by Devon Ryan91k
15
gravatar for Istvan Albert
3.6 years ago by
Istvan Albert ♦♦ 81k
University Park, USA
Istvan Albert ♦♦ 81k wrote:

Markdown editing has been enabled.

Old posts will be parsed into Markdown once we identify all the tricky posts that might break the process Changing the editing to markdown should have taken a lot less time. It is just one of these cases where aiming for a perfect solution became the enemy of good enough.

I mentioned this above, the Markdown library that we use supports the so called "fenced" code blocks. Enclosing code within triple backquotes on separate lines will mark that text as code. This is handy when indenting by four spaces is difficult. Example:

```
cat data.fq | grep "ATGC" | wc -l
```
ADD COMMENTlink modified 3.6 years ago • written 3.6 years ago by Istvan Albert ♦♦ 81k
11

Yaaay!

Kermit the frog going yay

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by Devon Ryan91k
1

Istvan,

The fenced code blocks work as blocks only when indented. When not, even if we do use triple quotes on new lines, the code is rendered formatted as red inline code but within a block.

```
cat data.fq | grep "ATGC" | wc -l
```

vs

cat data.fq | grep "ATGC" | wc -l

======================================================================================

EDIT: Well that backfired splendidly. The reason is, the preview doesn't show you what's actually going to happen.

For example, the preview: Preview_Image

becomes the actual content: Actual_Image

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by RamRS24k

Yes there is a bit of disconnect between what the preview editor shows and what the backend does. These are different libraries actually. Here is also the issue you opened.

https://github.com/ialbert/biostar-central/issues/401

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by Istvan Albert ♦♦ 81k

Wow, This is cool. I am surprised with comment box and answer box changes. But where is color highlighting? removed? I am editing this again after submitting, so the code sample option highlighting in red.

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by venu6.3k
1

Inlined code is red. That is code flanked with text.

Block code is syntax highlighted. Block code is separated by the body text via empty lines:

This is block code
ADD REPLYlink written 3.6 years ago by Istvan Albert ♦♦ 81k

You're the best

ADD REPLYlink written 3.6 years ago by RamRS24k

Great news! Will you enable the syntax for markdown spoilers?

Seems quite useful for the TL;DR part of posts,

! but not currently working

ADD REPLYlink modified 3.5 years ago • written 3.5 years ago by mikhail.shugay3.3k

We are trying to use existing markdown libraries (though we had to patch some code in the current package as well as in the bleach sanitizing library). What this also means is that we use of the features that these libraries already offer. Spoilers do not seem to be supported.

I hope that we can adopt Common Mark and eventually its extensions.

ADD REPLYlink written 3.5 years ago by Istvan Albert ♦♦ 81k
2
gravatar for A. Domingues
3.6 years ago by
A. Domingues2.1k
Dresden, Germany
A. Domingues2.1k wrote:

I would definitely appreciate using markdown to write posts.

Any news on progress?

ADD COMMENTlink written 3.6 years ago by A. Domingues2.1k
2
gravatar for dariober
3.6 years ago by
dariober10k
WCIP | Glasgow | UK
dariober10k wrote:

I must have missed this post when it was first posted. +1. I definitely support the idea.

ADD COMMENTlink written 3.6 years ago by dariober10k
2
gravatar for Istvan Albert
3.6 years ago by
Istvan Albert ♦♦ 81k
University Park, USA
Istvan Albert ♦♦ 81k wrote:

I am so down for this, I really dislike this editor that I've put in ... 

ADD COMMENTlink written 3.6 years ago by Istvan Albert ♦♦ 81k

I'd quote you on that, but since there's no way to quote in biostars, i'll code block you on that ;-)

No, in all seriousness Istvan, I first found out about Biostars not because of anything bioinformatics-related, but because I was looking for an opensource StackExchange-like Q and A system for my lab. I was a wetlab biologists back then, so I didn't really know the term "Bioinformatics" at all. After looking at a lot of options, and asking around different places, Biostars was unanimously the best. Then I re-found it a year later when I started programming :)

ADD REPLYlink written 3.6 years ago by John12k

GitHub's new comments editor looks like a fantastic hybrid approach to writing markdown first and supporting toolbar-centric editing second: https://github.com/blog/2097-improved-commenting-with-markdown.

The only problem is I cannot find their code for this, but I'm sure it's available...

ADD REPLYlink written 3.6 years ago by Matt Shirley9.1k

So, we implement this, correct? I do not know django, but it looks like an MVC framework, so we'd have to update the views. If you can show me an example, I can work on the others - I have experience with Razor and ASP.NET MVC2, but no open source MVC implementations.

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by RamRS24k

I did actually work it all out for Biostar 3 that was supposed to be released and had markdown by default. I just did not like how the rest of it turned out and got "canned". Let me take a look at my code and truth to be told it is not difficult to move to markdown it just needs about one good days of work. But lately I have a hard time setting that aside - it is not just one typical day, but one with no other interruptions etc.

I made a new github issue and will create a branch for it that will keep tagging this issue as work progresses. Please follow that:

https://github.com/ialbert/biostar-central/issues/399 

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by Istvan Albert ♦♦ 81k
7

Migrated the code base to Markdown. So far looks good and fully functional. Will test it more extensively with the real data on Friday and if all looks good will switch over during the weekend.

ADD REPLYlink written 3.6 years ago by Istvan Albert ♦♦ 81k
1

OK the markdown has been enabled. Various breakage may occur because in general handling user input can be quite challenging.

The markdown library that I am using supports fenced codeblocks. That means you can format code by enclosing the code within lines that contain only triple back quotes ``` This is easier to do than indenting by four spaces.

I am trying some new syntax highlighting that is bioinformatics tool aware, let's see:

bwa mem data.fq
ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by Istvan Albert ♦♦ 81k

wow, that is very fast! I was bumping it to get the issue back on table, and never expected anything to happen this fast. Thank you!

ADD REPLYlink written 3.6 years ago by A. Domingues2.1k
1
gravatar for Deepak Tanwar
3.6 years ago by
Deepak Tanwar4.0k
ETH Zürich, Switzerland
Deepak Tanwar4.0k wrote:

I am also in favor of it!

ADD COMMENTlink written 3.6 years ago by Deepak Tanwar4.0k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1775 users visited in the last hour