Using markdown for Prolog code in SWISH notebooks

27 views
Skip to first unread message

Stefan Kral

unread,
Jan 26, 2016, 6:09:50 AM1/26/16
to SWI-Prolog
Hello,

I'd like to use markdown for highlighting certain code parts (similar to related Prolog answers on StackOverflow like shown http://stackoverflow.com/a/13351469/4609915).

Naively, I tried using the SO-style (extended?) markdown syntax, but it does not work out.
--- snippet starts
<pre>
<s>list_list_concatenated([], Ys, Ys) :-
   <b>false</b>.</s>
list_list_concatenated([X|Xs], Ys, [X|Zs]) :-
   list_list_concatenated(Xs, Ys, Zs),
   <s><b>false</b></s>.
</pre>
--- snippet ends

So far, I tried using `code` in combination with "**" for bold-face, but that does not work either... Any ideas?

Regards,
Stefan.



Jan Wielemaker

unread,
Jan 26, 2016, 7:41:03 AM1/26/16
to Stefan Kral, SWI-Prolog
See http://www.swi-prolog.org/pldoc/man?section=wiki
Instead of ~~~{.pl} I'd use ``` to be compatible with GitHub.
Classical PlDoc uses ==:

==
list_list_concatenated([], Ys, Ys) :-
false.
...
==

Cheers --- Jan

Stefan Kral

unread,
Jan 26, 2016, 2:16:14 PM1/26/16
to SWI-Prolog, skra...@gmail.com
Hi Jan,

Thanks for your reply!

Just tried it in SWISH and == is working, BUT: I also want to have some parts of the code decorated with markups like strike-thru and/or bold-face---like in that StackOverflow answer I linked to.

Can I do that? Maybe using some low(er)-level HTML workaround / hack?

Best Regards,
Stefan.
Reply all
Reply to author
Forward
0 new messages