Automatically link to correct file (html/markdown/pdf)
I'm finding there's a conflict between two features here when
linking between documents. I am writing documentation that spans
several documents, and as such it's useful to include links that I
can traverse within Marked (to save me from having to jump to a
browser). However for this to occur, the links I create must have a
.md
extension. The problem is that the links still
have a .md
extension when I export to HTML or PDF. If
I give the links a .html
extension, then they don't
link properly in Marked.
Is there a way to produce a link to another document that is preserved regardless of the format? Including MMD, as I would like to keep the ability to traverse links between documents in Marked.
Thanks!
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 21 Jul, 2013 12:11 PM
I'm not sure this would be useful to enough people to be worth including as a default feature, but it could be easily scripted outside of Marked. You could go two ways:
1. a script that ran on generated HTML documents and converted an md links to html
2. a custom processor in Marked that let you use html links in your document but converted them to md links in the Marked preview before passing it to MMD
I'd be willing to help you with either if you need it.
2 Posted by cliffrowley on 21 Jul, 2013 07:14 PM
There must be other people working with multiple pages (e.g. for things like the technical documentation I am currently writing for a client which is just too large for a single page). And anyone who is working with multiple files will almost certainly find it useful to be able to traverse links between documents in Marked before finally generating the HTML.
The only problem I have with using a custom processor is that I can't seem to see a way to have a per-project processor (e.g. using metadata). I don't necessarily want to run all my files through this process (I work on lots of different things!). Otherwise I'd probably go with that as an option.
This, and the multiple window thing, make my workflow with Marked a very choppy one.
Support Staff 3 Posted by Brett on 21 Jul, 2013 07:20 PM
The solution I have for this is --- in the next major version update --- Marked can watch an entire folder and always display the most recently edited file in the same window. In general, Marked was not designed for interlinking documents and I'm sure you've noticed that once you follow a link things get a bit messed up. This is inherent to the file tracking setup as it stands now, but is smoothed out for the future.
The next version also allows you to set a custom processor as default or non, so you can enable it only when needed. It also includes an option to force-enable it via metadata.
Thanks,
Brett
4 Posted by cliffrowley on 21 Jul, 2013 07:37 PM
I guess that would probably suffice, as I could modify my workflow to use Marked just to preview the latest changed file and then do the full blown preview in the browser. At the same time then could you add an option to get Marked to pop to the foreground when it detects and reloads? That would at least mean I'm not then managing 2 previews and an editor..
Great news on setting the processor via metadata too.
But I can't help feeling that either Marked isn't really living up to its promise (for me and my workflow), or it's not the tool I thought it was and I'm asking too much of it. It just seems to me that things like the ability to jump between Markdown documents are a basic necessity for anyone doing anything with more than 1 page of Markdown at a time - which is why I now think that perhaps I've misunderstood it.
Support Staff 5 Posted by Brett on 21 Jul, 2013 07:51 PM
Have you looked at the multi-document capabilities at all? You can create an index file, view everything collectively and scroll to the position of the current change within the master document.
Jump to foreground is already built into the next version.
Support Staff 6 Posted by Brett on 21 Jul, 2013 07:56 PM
> But I can't help feeling that either Marked isn't really living up to its promise (for me and my workflow), or it's not the tool I thought it was and I'm asking too much of it. It just seems to me that things like the ability to jump between Markdown documents are a basic necessity for anyone doing anything with more than 1 page of Markdown at a time - which is why I now think that perhaps I've misunderstood it.
>
In regard to this, you are the first and only person (thus far) to ask for such a feature, so to state that Marked isn't living up to its promise seems a bit out of left field. Marked previews Markdown documents. That's the promise. Advanced, multi-document workflows are taken into account, but having to open multiple documents in an editor AND jump to new documents in Marked seems like an inconvenience. How would having it automatically follow the current document be less useful?
For complex editing of multi-document files, have you looked at Scrivener? Marked supports Scrivener projects and will allow you to do your organization in Scrivener and just keep up with you while you work.
7 Posted by cliffrowley on 21 Jul, 2013 08:31 PM
I intentionally specified for me and my workflow so that my comment might not be taken as a slight against Marked. It's not. But what I expect from a Markdown preview tool, is the ability to preview my Markdown whether it's in 1 document spread across 10. That was really my point there. Sorry if it didn't come across that way.
Regarding Scrivener - I actually want to use Markdown because I use it for everything. Whether it's documentation for outsourced developers, in house APIs, proposals, software docs for clients, or READMEs in GitHub or BitBucket, I use Markdown because it's just so damn simple to deal with both for me and for any scripts I might have written to generate the output I require. It just doesn't make sense for me (and my workflow) to use any other format.
Essentially it comes down to this: Marked is a great solution to the problem that there is no such thing as a WYSIWYG Markdown editor. A WYSIWYG editor for Markdown is of course a complete oxymoron because then why use Markdown, right? Right, but there is still a need to preview the final output as we go along - otherwise tools like Marked wouldn't exist. So that means we need at least two tools to do this. We need an editor and we need a previewer. The editor takes care of everything related to modifying the content, and it seems to me that the previewer should then take care of everything related to previewing the output - whether it's 1 file or 10, and whether they are linked together or concatenated. In this context, not having a true preview of the final output that includes the ability to jump between linked documents is what makes me feel that Marked isn't living up to my expectations (let's lay off the word promise, it was probably the wrong word to use).
TL;DR My editor takes care of everything related to editing, and I'd really like Marked to take care of everything related to previewing, which includes linking between documents.
I hope that makes more sense. Again, it may be that I've just misunderstood Marked's purpose.