tag:support.markedapp.com,2011-09-11:/discussions/questions/8687-newbie-question-how-to-convert-a-wikidot-to-an-offline-project-and-embed-imagesMarked: Discussion 2021-07-22T11:34:30Ztag:support.markedapp.com,2011-09-11:Comment/388189372016-01-03T17:16:20Z2016-01-03T17:16:20ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>That isn't markdown syntax for images. It would be</p>
<p><img alt="optional caption" src="path/to/image.png"></p>
<p>As far as converting a folder of files, Marked supports index
formats via LeanPub and mmd_merge styles, as well as include
syntax. I can provide additional info when I'm back at my main
computer.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/388189372016-01-03T17:20:36Z2016-01-03T17:20:36ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Thank you, Brett. I’ll test it right away :).</p>
<p>Hans</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-05T13:06:51Z2016-01-05T13:06:51ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>I have been reading the documentation and playing a little with
Marked. What a great software; if only I had discovered it
earlier!</p>
<p>I will now definitely start porting <a href="http://cafetran.wikidot.com">http://cafetran.wikidot.com</a> to a
Markdown project. I am planning to host it in HTML via a public
Dropbox folder. (Besides that, I also will be offering a PDF
version for print out and an ePub version for e-readers.)</p>
<p>Q: Does anyone have experience with hosting a HTML project via
Dropbox?</p>
<p>My storage location for maintaining the project (not necessarily
the same as the one for the public access) would be:</p>
<p>/Users/Hans/Dropbox/CT/Man</p>
<p>Q: If I would want to make the part before /Dropbox generic, so
that other persons can help me with writing and testing, from there
<em>own</em> Dropbox (e.g. /Users/AntonObermayer/Dropbox/CT/Man),
is there a way to code the path (e.g. to the embedded images)?</p>
<p>Regarding the HTML version of the CafeTran manual:</p>
<p>Q: What would be the easiest way to divide the webpage in 1/4
and 3/4, with the 1/4 column a the left-hand side containing the
TOC as navigation means?</p>
<p>Regarding the PDF version of the CafeTran manual:</p>
<p>I've understood that the internal links cannot be made clickable
(yet?), unless I use a work-around with Acrobat Pro (which I don't
have ;)).</p>
<p>Q: Is it possible to have the pages numbered and the page
numbers appear in the TOC?</p>
<p>Regarding the conversion from Wikidot markup to Markdown: I have
decided to do this in TextWrangler, using regular expressions etc.
After all, the conversion is pretty straight forward. However, with
454 Wiki articles it is a lot of work. Currently I am looking for a
specific regular expression:</p>
<p>Q: Does anyone have a regular expression (preferably for
TextWrangler) on shelf to convert Wikidot-style links to their
Markdown counterparts? E.g. [<a href="http://www.barebones.com/products/textwrangler">http://www.barebones.com/products/textwrangler</a>
TextWrangler for Mac] to <a href="http://www.barebones.com/products/textwrangler">TextWrangler</a>.</p>
<p>Currently I have the images related to a single Wiki article
located in a folder with the name of the article (as this is how
Wikidot created an export of my database).</p>
<p>So the images belonging to
/Users/Hans/Dropbox/CT/Man/source/adding-an-existing-glossary.txt
are located in the folder
/Users/Hans/Dropbox/CT/Man/files/adding-an-existing-glossary. For
the time being, I will maintain this structure (at a later moment,
when I am making new screenshots, I will probably start using one
central folder for all PNGs.) For now: I will have to insert the
name of the folder containing the images belonging to specific
article, in the path to the linked images. E.g. for the article Add
the current Wikidot notation is:</p>
<p>[[image 14.png width="680" title="Click to enlarge the image"
link="*local--files/adding-glossary-terms/14.png" style="border:
1px solid gray;"]]</p>
<p>In Markdown this would be:</p>
<p><img src="/Users/Hans/Dropbox/CT/Man/files/adding-glossary-terms/14.png" alt=""></p>
<p>Q: Does someone have a way to have the file name of the article
(adding-glossary-terms.md) inserted (without the extension) in an
image link as above?</p>
<p>I have already experimented with Multi-file documents and that
was the point where I started to see the great power of Marked 2!
Wow!</p>
<p>Before I am getting too enthusiastic, some questions:</p>
<p>Q: What is the maximal depth of nesting Multi-file
documents?</p>
<p>Q: What is the maximal number of files to nest in total (can I
nest/embed all 454 MDs)?</p>
<p>Q: How to insert structurising headings in the TOC? E.g.:</p>
<p>III. Interoperability with other tools</p>
<ol>
<li>memoQ</li>
<li>Déjà Vu</li>
<li>SDL</li>
</ol>
<p>The only way that I see is to create a dummy article that only
contains the heading.</p>
<p>Thank you very much for all suggestions!</p>
<p>Hans</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-05T14:48:16Z2016-01-05T14:48:16ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>In an attempt to solve this myself:</p>
<p>Q: Does someone have a way to have the file name of the article
(adding-glossary-terms.md) inserted (without the extension) in an
image link as above?</p>
<p>I tried this:</p>
<ol>
<li>Copy the MD files to the folder that contain the PNGs.<br></li>
<li>Embed the images in the MD files without any path: <img alt="" src="preparation.png"></li>
</ol>
<p>When I saved everything, in Marked 2 the images for one opened
MD where visible.</p>
<p>Then I created the Master.MD:</p>
<h1><a name="document-title" href="#document-title" class="anchor"></a>Document title</h1>
<!--TOC-->
<p><<[/Users/Hans/Desktop/xlz/xlz.md]</p>
<p>
<<[/Users/Hans/Desktop/adding-glossary-terms/adding-glossary-terms.md]</p>
<p>As it turned out, Marked 2 couldn't find the path to the images
in the included MDs.</p>
<p>I had to change the path to:</p>
<p><img alt="" src="/Users/Hans/Desktop/xlz/preparation.png"></p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-05T15:52:17Z2016-01-05T15:52:17ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Most of this is beyond Marked's stated features and requires
additional coding. If you're interested, I can contact you
privately with rates and an estimate. To answer a few
Marked-related questions, though:</p>
<blockquote>
<p>Q: Is it possible to have the pages numbered and the page
numbers appear in the TOC?</p>
</blockquote>
<p>Not at the current time. Once I've finished the RTF export
rewrite, I intend to tackle a custom PDF generator that will
provide both working internal links and features such as this. In
its current incarnation, the TOC is generated from headlines at a
point where the file isn't paginated yet, so it really has no means
of determining where the anchor is going to fall after
pagination.</p>
<blockquote>
<p>So the images belonging to
/Users/Hans/Dropbox/CT/Man/source/adding-an-existing-glossary.txt
are located in the folder
/Users/Hans/Dropbox/CT/Man/files/adding-an-existing-glossary. For
the time being, I will maintain this structure (at a later moment,
when I am making new screenshots, I will probably start using one
central folder for all PNGs.) For now: I will have to insert the
name of the folder containing the images belonging to specific
article, in the path to the linked images. E.g. for the article Add
the current Wikidot notation is:</p>
</blockquote>
<p>This is currently a sore spot when including multiple files in a
single document. Once the main document is compiled, any relative
references within subfolders break because it builds them from the
root document instead of the document within the subfolder. It's an
issue that I could solve by rewriting image paths during
processing, but I've always felt that might cause more issues than
it would solve. I'm reconsidering that, but at the current time you
either need a central folder (as you mentioned) with images
resolved to an absolute path or a relative path from the
destination index document.</p>
<p>Beyond that, a custom pre-processor could (possibly) handle the
rewriting, using the environment variables Marked passes to
processors to rewrite image paths. It would likely be complex as
even the pre-processor doesn't run until after the included
documents are compiled, erasing the obvious idea of rewriting based
on current file path.</p>
<blockquote>
<p>Q: Does anyone have a regular expression (preferably for
TextWrangler) on shelf to convert Wikidot-style links to their
Markdown counterparts? E.g. [<a href="http://www.barebones.com/products/textwrangler">http://www.barebones.com/products/textwrangler</a>
TextWrangler for Mac] to <a href="http://www.barebones.com/products/textwrangler">TextWrangler</a>.</p>
</blockquote>
<p>This isn't necessarily a Marked feature, but you can script this
pretty easily to run on the entire folder (probably using Ruby or
Python) and searching for:</p>
<pre>
<code>\[(\S+) (.*?)\]</code>
</pre>
<p>and replacing with the template:</p>
<pre>
<code>[$2]($1)</code>
</pre>
<p>You'd want to strip any leading and trailing whitespace from $2
in order to ensure Markdown compatibility.</p>
<blockquote>
<p>Q: What is the maximal depth of nesting Multi-file
documents?</p>
<p>Q: What is the maximal number of files to nest in total (can I
nest/embed all 454 MDs)?</p>
</blockquote>
<p>There shouldn't be a limit, but I haven't tested with that many
includes or nested includes beyond 3 levels. It may cause slower
rendering, but it <em>should</em> work.</p>
<blockquote>
<p>Q: How to insert structurising headings in the TOC? E.g.:</p>
</blockquote>
<p>The easiest way would be to include the headers in the index
document prior to the include directive. This would only work if
you were using Marked's include syntax and not one of the index
formats (leanpub or mmd_merge). You'd use something like:</p>
<pre>
<code>## Interoperability with other tools
<<[memoQ.md]
<<[Déjà-Vu.md]
## Next category
[...]</code>
</pre>
<p>If the generation of the index file were scripted, you could
then inject a level 3 header at the top of each file based on the
filename. The script would read in all of the files, regex replace
the wiki syntax, add the header, and then rewrite the original file
(or save to a ".md" copy). Then it would add the
<code><<[]</code> directive to the index file with the path
to the current filename. The <code>## Section</code> title could
also be created from the subfolder name and inserted at the
beginning of each processed subfolder.</p>
<p>Like I said, that's well beyond Marked's built-in functionality,
but I can consult on the generation script if needed.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/388189372016-01-05T16:35:07Z2016-01-05T16:35:07ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Thank you very much, Brett!</p>
<p>I’ll study your answers very thoroughly. I hope you
don’t mind that some questions indeed exceeded the limits of
Marked 2.</p>
<p>Cheers,</p>
<p>Hans</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-05T16:59:45Z2016-01-05T16:59:45ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Thanks, Brett!</p>
<p>With your help I could create the TW syntax for this
question:</p>
<p>Q: Does anyone have a regular expression (preferably for
TextWrangler) on shelf to convert Wikidot-style links to their
Markdown counterparts? E.g. [<a href="http://www.barebones.com/products/textwrangler">http://www.barebones.com/products/textwrangler</a>
TextWrangler for Mac] to TextWrangler.</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-08T09:23:31Z2016-01-08T09:23:31ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>I'm making good progress with the conversion process.</p>
<p>I have some more questions:</p>
<p>When I want to have a TOC in the master document, I noticed that
it's not enough to insert the tag <!--TOC--> only in the
master document, before the listing of the included
subdocuments.</p>
<p>I also have to insert a <!--TOC--> at the start of every
subdocument.</p>
<p>Q: Is this observation correct?</p>
<p>One other question:</p>
<p>I'm trying to shorten the link to the embedded images from:</p>
<p><img alt="" src="/Users/Hans/Dropbox/CT/Man/en-GB/a-glossary-is-not-a-dictionary-dev1.png"></p>
<p>to something more generic like:</p>
<p><img alt="" src="%CB%9C/Dropbox/CT/Man/a-glossary-is-not-a-dictionary-dev1.png"></p>
<p>I have tried several ways, including using the tilde and
inserting a Transclude statement at the top of every
subdocument.</p>
<p>Q: Is there no way to shorten the path to the images while they
are still displayed in the master document?</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-10T07:46:23Z2016-01-10T07:46:23ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><blockquote>
<p>I also have to insert a <!--TOC--> at the start of every
subdocument. Q: Is this observation correct?</p>
</blockquote>
<p>I think that I've misunderstood this. I've now created an HTML
export:</p>
<p><a href="https://dl.dropboxusercontent.com/u/15919910/ct/index.html">https://dl.dropboxusercontent.com/u/15919910/ct/index.html</a></p>
<p>and the Master TOC is repeated at the start of every included
sub document.</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-10T09:08:06Z2016-01-10T09:08:06ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>I just created a paginated PDF output. This one only contains
one central TOC. That's different behaviour from the HTML creator.
I'm a little puzzled now.</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-11T07:55:05Z2016-01-11T07:55:05ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>I have finished the conversion of my wikidot site to Markdown
and I'm still very enthusiastic about this language and about
Marked 2 as a tool.</p>
<p>I can now start the arranging of the individual files to a
logical structure, via a skeleton document 'index.md':</p>
<p>Transclude Base: ~/Dropbox/CT/Man/en-GB/</p>
<h1><a name="cafetran-training-manual" href="#cafetran-training-manual" class="anchor"></a>CafeTran Training Manual</h1>
<h2><a name="table-of-contents" href="#table-of-contents" class="anchor"></a>Table
of Contents</h2>
<!--TOC-->
<p><<[a-glossary-is-not-a-dictionary.md]<br>
<<[abbreviations.md]<br>
<<[about-dialog.md]<br>
<<[about.md]<br>
<<[adding-an-existing-glossary.md]</p>
<p>I have some advanced questions now and hope that someone will
take the time to answer them.</p>
<p>Regarding PDF output: Is it possible to create one global TOC
via index.md and let every included chapter begin with its own
small TOC?</p>
<p>Regarding HTML output: I now have one big file index.HTML that
looks okay, but that requires a long loading time (its size is
about 240 MB). Is it possible to split this huge files in smaller
parts?</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-12T01:25:16Z2016-01-12T01:25:16ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Table of contents can only be generated once per combined
document. Any other smaller TOCs would have to be manually
generated.</p>
<p>The HTML file size is possibly because you're choosing to embed
images in the exported file. Making them external would greatly
reduce file size.</p>
<p>My initial understanding was that your intent was pdf or doc,
not html. What is your goal with multiple html files? That sounds a
lot like where you started to me.</p>
<p>Thanks,</p>
<p>Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/388189372016-01-12T07:54:31Z2016-01-12T07:54:31ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><blockquote>
<p>My initial understanding was that your intent was pdf or doc,
not html. What is your goal with multiple html files? That sounds a
lot like where you started to me.</p>
</blockquote>
<p>I want to offer the manual in two or three different forms: PDF
and ePub for offline reading and HTML for online reading during the
use of the software (quick reference).</p>
<p>I thought that splitting up the HTML in smaller part would make
the loading time acceptable. But I'll try how fast the loading time
is when the images are external. I guess that they will be copied
to the folder where I let Marked 2 create the index.HTML. I also
assume that the images will be loaded as soon as they will be
displayed, thus reducing the loading time of the manual.</p>
<p>We'll see :). I was suggested to use a tool like Help &
Manual, but I rather want to use Markdown (and Marked), because of
its simplicity.</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-12T14:47:17Z2016-01-12T14:47:17ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Marked won't copy images, nor will it provide "lazy loading" to
improve render time. Splitting at least the major sections apart
would be preferable, but Marked would require you to create index
files for each section.</p>
<p>For a split-up HTML version (which is well beyond Marked's
intended use) you'd really be best off using a wiki like gollum or
a static site generator that works with markdown.</p>
<p>Thanks,</p>
<p>Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/388189372016-01-12T16:08:25Z2016-01-12T16:08:25ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Thank you!</p>
<p>That's really great to read that there exists a wiki system like
Gollum that can process Markdown without further conversion.</p>
<p>For the time being, I'll focus on the PDF output, since this is
what users of the CafeTran wikidot always were asking for.</p>
<p>I appreciate your great help!</p>
<p>Hans</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-17T16:42:21Z2016-01-17T16:42:21ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>I've started to write the TOC (structure) of the new CafeTran
manual (<a href="http://CafeTran-Training.com">http://CafeTran-Training.com</a>)
and was wondering:<br>
- Can I use Marked 2 to create an ePub version of my Markdown
document? - Can the output to DOCX assign styles to the
headings?</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-17T17:15:44Z2016-01-17T17:15:44ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Marked does not currently export ePub, but there are conversion
tools<br>
that can take Markdown that Marked exports and handle the book
creation.</p>
<p>DOCX is currently a glorified RTF export, and does not support
element<br>
styles. This is being updated in the next couple of months to
export<br>
fully styleable DOCX formats.</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/388189372016-01-17T17:18:15Z2016-01-17T17:18:15ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><blockquote>
<p>fully styleable DOCX formats</p>
</blockquote>
<p>I'm really impressed!</p>
<p>Many thanks</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-21T16:50:27Z2016-01-21T16:50:27ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Is Marked very tolerant for syntax errors in Markdown?</p>
<p>When I read this sentence again, I find it a little strange.
After all: Markdown is about simplicity and syntax sounds like
Latin and complex.</p>
<p>The reason why I'm asking this is because I bought to apps for
my iPhone 6. First Byword: it crashed all the time while opening a
MD file that I created in TextWrangler and that looked okay in
Marked.</p>
<p>Then I bought 1Writer. It could open my MDs but the files looked
strange. I had to insert an empty line after bulleted lists and
before headings.</p>
<p>In Marked this wasn't necessary. So is Marked more tolerant than
1Writer?</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-21T21:53:27Z2016-01-21T21:53:27ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Every language has a syntax, even English :).</p>
<p>Marked normalizes a certain amount of formatting that would
throw one<br>
processor off but not another. In general, empty lines are
highly<br>
encouraged around every element (headlines, lists, tables,
paragraphs,<br>
etc.).</p>
<p>Marked also offers two different built-in processors,
MultiMarkdown and<br>
Discount, both of which will treat certain syntax in different
ways. For<br>
the best compatibility across all processors, there are definitely
rules<br>
you can take into account:<br>
<a href="http://brettterpstra.com/2015/08/24/write-better-markdown/">http://brettterpstra.com/2015/08/24/write-better-markdown/</a></p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/388189372016-01-23T07:23:57Z2016-01-23T07:23:57ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>That's a very niece text, Brett! Thanks for the link.</p>
<p>I've now replaced all tabs with four spaces and set the display
font in TextWrangler to Monaco (monospaced), so the tables look
nice too.</p>
<p>Is it possible to define external links to URLs in a new browser
tab?</p></div>Hanstag:support.markedapp.com,2011-09-11:Comment/388189372016-01-23T13:52:18Z2016-01-23T13:52:18ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>Not with Markdown, but you can use a snippet of JavaScript to do
so on<br>
page load:</p>
<p>That will find any links in the current page that link to other
hosts<br>
and set the target attribute to "_blank".</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/388189372021-07-22T11:34:27Z2021-07-22T11:34:29ZNewbie question: How to convert a Wikidot to an offline project and embed images<div><p>I've wrote some kind of offline convertor that handles most Wikidot syntax features:<br>
<a href="https://github.com/IlyaOvodov/wikidot2markdown">https://github.com/IlyaOvodov/wikidot2markdown</a></p></div>Ovod