Highlighting interactive REPL sessions.

Oleksandr Gavenko <[email protected]>
Newsgroups gmane.text.docutils.user
Organization Oleksandr Gavenko <[email protected]>, http://defun.work/
Message-ID <[email protected]>
How can I highlight interactive REPL sessions? Like:

  bash# cd ~/sql
  bash# mysql
  Password:
  
  [mariadb]> select 1;

Among:

  http://pygments.org/docs/lexers/

I see possibility to use various:

  .. code:: bash
  .. code:: console
  .. code:: pycon
  .. code:: postgresql-console

but even with Bash it only highlight "$" sign and think my "bash#" prompt as
output...

I see a way to add to "code" additional parameter (prompt regex):

  http://docutils.sourceforge.net/docs/ref/rst/directives.html#code

and implement parser in pygments or make own directive:

  .. repl::
     :prompt1: "^bash# "
     :prompt2: "^$ "
     :prompt3: "^mysql> "

Does anyone work on this?

-- 
http://defun.work/


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.