"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/plugins/cpp_ref_qtproject_org.lua" (12 May 2020, 1557 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lua source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "cpp_ref_qtproject_org.lua": 3.53_vs_3.54.

    1 
    2 Description="Add doc.qt.io reference links to HTML, LaTeX, RTF and ODT output of C++ code"
    3 
    4 Categories = {"c++", "qt", "html", "rtf", "latex", "odt" }
    5 
    6 -- optional parameter: syntax description
    7 function syntaxUpdate(desc)
    8 
    9   if desc~="C and C++" then
   10     return
   11   end
   12 
   13   function getURL(token)
   14     url='http://doc.qt.io/qt-5/'..string.lower(token).. '.html'
   15 
   16     if (HL_OUTPUT== HL_FORMAT_HTML or HL_OUTPUT == HL_FORMAT_XHTML) then
   17       return '<a class="hl" target="new" href="' .. url .. '">'.. token .. '</a>'
   18     elseif (HL_OUTPUT == HL_FORMAT_LATEX) then
   19       return '\\href{'..url..'}{'..token..'}'
   20     elseif (HL_OUTPUT == HL_FORMAT_RTF) then
   21       return '{{\\field{\\*\\fldinst HYPERLINK "'..url..'" }{\\fldrslt\\ul\\ulc0 '..token..'}}}'
   22     elseif (HL_OUTPUT == HL_FORMAT_ODT) then
   23       return '<text:a xlink:type="simple" xlink:href="'..url..'">'..token..'</text:a>'
   24     end
   25   end
   26 
   27   function Decorate(token, state)
   28     if (state ~= HL_STANDARD and state ~= HL_KEYWORD and state ~=HL_PREPROC) then
   29       return
   30     end
   31     if string.find(token, "Q%u%l")==1 then
   32       return getURL(token)
   33     end
   34   end
   35 
   36 end
   37 
   38 function themeUpdate(desc)
   39   if (HL_OUTPUT == HL_FORMAT_HTML or HL_OUTPUT == HL_FORMAT_XHTML) then
   40     Injections[#Injections+1]="a.hl, a.hl:visited {color:inherit;font-weight:inherit;}"
   41   elseif (HL_OUTPUT==HL_FORMAT_LATEX) then
   42     Injections[#Injections+1]="\\usepackage[colorlinks=false, pdfborderstyle={/S/U/W 1}]{hyperref}"
   43   end
   44 end
   45 
   46 Plugins={
   47 
   48   { Type="lang", Chunk=syntaxUpdate },
   49   { Type="theme", Chunk=themeUpdate },
   50 
   51 }