← Back to team overview

nxhtml team mailing list archive

[Question #232313]: A set the mode from one regex to some other regexp

 

New question #232313 on nXhtml:
https://answers.launchpad.net/nxhtml/+question/232313

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml";>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <title>bk_templates_sphinx</title>
    
    
    
    
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="None" href="index.html#document-index"> 
  </head>
  <body>
<style type="text/css">
h1:hover > a.headerlink { visibility: visible !important; }
h2:hover > a.headerlink { visibility: visible !important; }
h3:hover > a.headerlink { visibility: visible !important; }
h4:hover > a.headerlink { visibility: visible !important; }
h5:hover > a.headerlink { visibility: visible !important; }
h6:hover > a.headerlink { visibility: visible !important; }
dt:hover > a.headerlink { visibility: visible !important; }
dt:target { background-color: #fbe54e !important; }
.footnote:target { background-color: #ffa !important; }
div.viewcode-block:target { margin: -1px -10px !important; padding: 0 10px !important; }
></style>  

    <div class="document" style="width: 100%; margin: 0;">
      <div class="documentwrapper" style="width: 100%; margin: 0;">
          <div class="body">
            
  <div class="toctree-wrapper compound">
</div>
<p>Here's a way to make latex mode from: <tt class="docutils literal"><span class="pre">..</span> <span class="pre">math::\n\n</span></tt> to <tt class="docutils literal"><span class="pre">..</span></tt>:</p>
<div class="highlight-cl">
<div class="highlight"><pre style="font-family: 'DejaVu Sans Mono', Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace !important; font-size: 16px; color: #333333; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; display: block; line-height: 26px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #ffffdd; margin: 0 0 13px; padding: 12.5px; border: 1px solid rgba(0,0,0,0.15);"><span class="p">(</span><span class="nb" style="color: #007020;">defun</span> <span class="nv" style="color: #bb60d5;">rst-bk-latex-directive-chunk</span> <span class="p">(</span><span class="nv" style="color: #bb60d5;">pos</span> <span class="nb" style="color: #007020;">min</span> <span class="nb" style="color: #007020;">max</span><span class="p">)</span>
  <span class="s" style="color: #4070a0;">"Find math chunks.  Return range and 'latex-mode.</span>
<span class="s" style="color: #4070a0;">See `mumamo-find-possible-chunk' for POS, MIN and MAX."</span>
  <span class="p">(</span><span class="nv" style="color: #bb60d5;">mumamo-quick-static-chunk</span> <span class="nv" style="color: #bb60d5;">pos</span> <span class="nb" style="color: #007020;">min</span> <span class="nb" style="color: #007020;">max</span> <span class="s" style="color: #4070a0;">".. math::\n\n"</span> <span class="s" style="color: #4070a0;">".."</span> <span class="no" style="color: #60add5;">nil</span> <span class="ss" style="color: #517918;">'latex-mode</span> <span class="no" style="color: #60add5;">t</span><span class="p">))</span>

<span class="c1" style="color: #408090; font-style: italic;">;;;###autoload</span>
<span class="p">(</span><span class="nv" style="color: #bb60d5;">define-mumamo-multi-major-mode</span> <span class="nv" style="color: #bb60d5;">rst-bk-mumamo-mode</span>
 <span class="s" style="color: #4070a0;">"Turn on multiple major modes for Python with RestructuredText docstrings."</span>
 <span class="p">(</span><span class="s" style="color: #4070a0;">"ReST"</span> <span class="nv" style="color: #bb60d5;">rst-mode</span>
  <span class="p">(</span>
   <span class="nv" style="color: #bb60d5;">rst-bk-latex-directive-chunk</span>
   <span class="p">)))</span>
</pre></div>
</div>
<p>Can You please provide a snippet to make it from regexp, to regexp?</p>


          </div>
      </div>
      <div class="clearer" style="clear: both;"></div>
    </div>
  </body>
</html>


-- 
You received this question notification because you are a member of
nXhtml, which is an answer contact for nXhtml.