Loading ...
Sorry, an error occurred while loading the content.

Clips for Creating Web Pages Of Clips

Expand Messages
  • Larry Hamilton
    I built two clips for creating web pages of clips. They are basically the same. They both take clip code (copy it into a regular document first) and mark it up
    Message 1 of 1 , Feb 19, 2005
    • 0 Attachment
      I built two clips for creating web pages of clips. They are basically
      the same. They both take clip code (copy it into a regular document
      first) and mark it up with HTML and CSS to display with NoteTab clip
      syntax highlighting.

      I am in the process of moving my NoteTab information to my new website.
      It is at this direct link. http://kairoscomputers.com/notetab/ I do not
      have it cleaned up enough to link from the main pages yet.

      I also plan to organize my notes for running NoteTab on Linux. I am
      posting a quick web page from an OTL of Linux posts and will add more
      information, that is more clear at a later date.

      The following clip is for making <pre></pre> delimited HTML out of one
      clip, for pasting into an existing HTML document, colored with NoteTab
      clip syntax highlighting.

      ---------< start clip >---------
      H="Clip To HTML - Wrap in <pre>"
      ;Larry Hamilton <larry@...>
      ;02/19/2005 Larry Hamilton
      ;Convert clips to HTML for posting online.
      ;Assumes a correct Stylesheet exists in the web page this will be added to.
      ;^!SetDebug ON
      ^!SetWordWrap Off
      ^!SetCursor 1:1

      ^!Set %numlines%=^$GetLineCount$
      ^!Set %i%=1
      :START
      ;^!SetDebug ON
      ^!If ^%i%>^%numlines% CONVERT2HTML
      ^!Select +1
      ^!Set "%Selection%" = ^$GetSelection$
      ^!IfSame "^$GetSelection$" ":" LABELS else Next
      ^!IfSame "^$GetSelection$" ";" COMMENTS else Next
      ;Next one checks for ^, which can be either command or function.
      ^!IfSame "^$GetSelection$" "^" COMMANDS else Next
      ^!IfSame "^$GetSelection$" "^%NL%" LOOP else Next
      ;If none of the other possibilities, it is the Clip Header.
      ^!Jump Select_Start
      ^!Select EOL
      ^!InsertText <span class="clipheader">H="^$GetSelection$"</span>
      ^!Set %Title%="^$GetSelection$"
      :LOOP
      ^!Inc %i%
      ^!SetCursor ^%i%:1
      ^!GoTo START

      :LABELS
      ^!Jump Select_Start
      ^!Select EOL
      ^!InsertText <span class="red">^&</span>
      ^!GoTo LOOP

      :COMMENTS
      ^!Jump Select_Start
      ^!Select EOL
      ^!InsertText <span class="gray">^&</span>
      ^!GoTo LOOP

      :COMMANDS
      ;^!SetDebug ON
      ^!Jump Select_Start
      ^!SetCursor ^%i%:2
      ^!Select +1
      ^!IfSame "^$GetSelection$" "$" FUNCTIONS else Next
      ^!Jump LINE_Start
      ^!Select EOL
      ^!InsertText <span class="blue">^&</span>
      ^!GoTo LOOP

      :FUNCTIONS
      ^!Jump LINE_Start
      ^!Select EOL
      ^!InsertText <span class="green">^&</span>
      ^!GoTo LOOP

      :CONVERT2HTML
      ^!SetCursor 1:1
      <pre>^%NL%<-- Copy below this line. -->^%NL%
      ^!Jump Text_End
      ^%NL%<-- Copy above this line. -->^%NL%</pre>
      ---------< end clip >-----------

      The following clip is for making one web page out of one clip, colored
      with NoteTab clip syntax highlighting.

      ---------< start clip >---------
      H="Clip to HTML - 1 Clip Per Page"
      ;Larry Hamilton <larry@...>
      ;02/19/2005 Larry Hamilton
      ;Convert clips to HTML for posting online.
      ;^!SetDebug ON
      ^!SetWordWrap Off
      ^!SetCursor 1:1

      ^!Set %numlines%=^$GetLineCount$
      ^!Set %i%=1
      :START
      ;^!SetDebug ON
      ^!If ^%i%>^%numlines% CONVERT2HTML
      ^!Select +1
      ^!Set "%Selection%" = ^$GetSelection$
      ^!IfSame "^$GetSelection$" ":" LABELS else Next
      ^!IfSame "^$GetSelection$" ";" COMMENTS else Next
      ;Next one checks for ^, which can be either command or function.
      ^!IfSame "^$GetSelection$" "^" COMMANDS else Next
      ^!IfSame "^$GetSelection$" "^%NL%" LOOP else Next
      ;If none of the other possibilities, it is the Clip Header.
      ^!Jump Select_Start
      ^!Select EOL
      ^!InsertText <span class="clipheader">H="^$GetSelection$"</span>
      ^!Set %Title%="^$GetSelection$"
      :LOOP
      ^!Inc %i%
      ^!SetCursor ^%i%:1
      ^!GoTo START

      :LABELS
      ^!Jump Select_Start
      ^!Select EOL
      ^!InsertText <span class="red">^&</span>
      ^!GoTo LOOP

      :COMMENTS
      ^!Jump Select_Start
      ^!Select EOL
      ^!InsertText <span class="gray">^&</span>
      ^!GoTo LOOP

      :COMMANDS
      ;^!SetDebug ON
      ^!Jump Select_Start
      ^!SetCursor ^%i%:2
      ^!Select +1
      ^!IfSame "^$GetSelection$" "$" FUNCTIONS else Next
      ^!Jump LINE_Start
      ^!Select EOL
      ^!InsertText <span class="blue">^&</span>
      ^!GoTo LOOP

      :FUNCTIONS
      ^!Jump LINE_Start
      ^!Select EOL
      ^!InsertText <span class="green">^&</span>
      ^!GoTo LOOP

      :ALMOSTDONE

      :CONVERT2HTML
      ;^!SetDebug ON
      ^!SetCursor 1:1
      ;^!MENU Modify/Document to HTML/With Paragraph Tags
      ^!MENU Modify/Document to HTML/No Character Conversion
      ^!SetCursor 1:1
      ;
      ;----------------------[begin long line]---------------------------
      ^!InsertText <!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0
      Transitional//EN">^%NL%
      ;-----------------------[end long line]----------------------------
      ;
      ^!Find </TITLE> WIS
      ^!Jump Line_End
      ^%NL%<style type="text/css">
      .clipheader
      {
      font-family : "Times New Roman";
      font-style : normal;
      font-size : 14pt;
      color: black;
      font-weight: bold;
      }
      .gray
      {
      font-family : "Times New Roman";
      font-style : normal;
      font-size : 14pt;
      color: gray;
      }
      .red
      {
      font-family : "Times New Roman";
      font-style : normal;
      font-size : 14pt;
      color: red;
      }
      .blue
      {
      font-family : "Times New Roman";
      font-style : normal;
      font-size : 14pt;
      color: blue;
      }
      .green
      {
      font-family : "Times New Roman";
      font-style : normal;
      font-size : 14pt;
      color: green;
      }
      </style>
      ^!SetDebug ON
      ;^!Set %title%=^?{What do you want to call this FAQ?=OWF_NOTES}
      ;^!Set %Title% = ^? {Web Page Title?}
      ;^!Find "*** Your Title Here ***" WAIS
      ^!Replace "*** Your Title Here ***" >> "^%Title%" WAIS
      ;^!Replace XXTITLE ^%Title% AWS
      ^!Set %FileName%=^?[Filename?(Do not add ext.=]
      ^!Save AS G:\NoteTab\Documents\MySite\^%FileName%.htm

      ;^!Set %Title%=^? [Title? = ]
      ;^!Replace XXTITLE ^%Title% AWS
      ;^!Set %FileName%=^?[Filename?(Do not add ext.= ]
      ;^!Save AS D:\NoteTab\Documents\MySite\^%FileName%.htm
      ---------< end clip >-----------


      --
      Larry Hamilton
      Kairos Computer Solutions
      http://www.kairoscomputers.com/
      Sales Affiliate for Grisoft Anti-Virus
    Your message has been successfully submitted and would be delivered to recipients shortly.