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

20044RE: [Clip] HTML to wikiHow conversion clip

Expand Messages
  • John Shotsky
    Dec 1, 2009
      Phillip, it would be a little easier if you include one actual example of each line you want to convert, and then how
      they should appear after the conversion.



      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Mr. Phillip Sand Hansel II
      Sent: Tuesday, December 01, 2009 2:21 PM
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] HTML to wikiHow conversion clip


      I saw there was some discussion in the past on using NoteTab to make wiki documents, but could not find a clipbook on
      converting HTML to wikiHow syntax.

      I am trying to convert web pages to something wikiHow understands, and have come up with a substitution clip that works
      fairly well, but is probably not as elegant as possible. My humble approach attacks the start and end tags individually.

      WikiHow has it's own simple syntax. There is a second level header denoted by == Header 2 ==.
      There are URL links denoted by [[link description]].
      There are image links denoted by [[Image: imagename.jpg|thumb| description]].
      There are table markup tags; which are too complicated for me to understand how to translate (out of my scope,

      My clip so far looks like this... any suggestions appreciated.

      ; convert HTML to WikiHow markup
      ^!Jump DOC_START
      ; Convert various Headers to 2nd level hdr used by wikiHow.
      ^!Replace <H1> == SICHA
      ^!Replace <H2> == SICHA
      ^!Replace <H3> == SICHA
      ^!Replace <H4> == SICHA
      ^!Replace <H5> == SICHA
      ^!Replace </H1> == SICHA
      ^!Replace </H2> == SICHA
      ^!Replace </H3> == SICHA
      ^!Replace </H4> == SICHA
      ^!Replace </H5> == SICHA
      ;Convert List items to wikiHow ordered list flags (#)
      ^!Replace <LI> # SICHA
      ^!Replace </LI> SICHA
      ;Convert paragraphs to wikiHow ordered list flags? (#)
      ^!Replace <P> # SICHA
      ^!Replace </P> SICHA
      ;Convert links to wikiHow syntax
      ^!REPLACE <A HREF=" [[ SICHA
      ^!REPLACE </A> ]] SICHA

      ;Convert image links to wikiHow syntax
      ^!REPLACE <IMG SRC=" [Image: SICHA
      ; replace image attributes with nothing
      ^!Replace "WIDTH=\"...\"" >> "" WRS
      ^!Replace "HEIGHT=\"...\"" >> "" WRS
      ^!Replace "BORDER=\".*\"" >> "" WRS
      ^!Replace "ALT=\".+\"" >> "" WRS
      ;Fix straggler closing angle brackets?
      ^!Replace " > "" WRS
      ^!Replace " > "" WRS
      ^!Replace " > "" WRS
      ;And then add "strip HTML markup" menu item? Currently doing manually after above substitutions have been made.

      Mr. Phillip Sand Hansel II

      [Non-text portions of this message have been removed]

      [Non-text portions of this message have been removed]
    • Show all 8 messages in this topic