1. I'm a happy (64-year old, retired) enduser of textmate, not a programmer. 2. I'm using a textmate project as my "personal textbase". The project has many markdown files. I don't use markdown as a source to convert to html but as the real thing, as my final product (with an occasional preview for reading convenience). 3. My markdown file is a container for one or more articles, each about a separate topic. Every article is uniquely identified by a tag in the form of a string "tagid=<tagid>". 4. I'm using crossreferences to other articles in the form of a string "tagref=<tagid>". 5. To link from a tagref to the associated unique tagid I use the "Find in Project" dialog. I type "tagid=<tagid>" and click the single link in the result to load the relevant file. 6. I love to have the following command: with the caret in a "tagref=<tagid>" reference and pushing the enter key, the relevant file automatically loads. 7. I have no idea how to make this command; help is appreciated.
Bert Fitié wrote:
- I'm a happy (64-year old, retired) enduser of textmate, not a
programmer. 2. I'm using a textmate project as my "personal textbase". The project has many markdown files. I don't use markdown as a source to convert to html but as the real thing, as my final product (with an occasional preview for reading convenience). 3. My markdown file is a container for one or more articles, each about a separate topic. Every article is uniquely identified by a tag in the form of a string "tagid=<tagid>". 4. I'm using crossreferences to other articles in the form of a string "tagref=<tagid>". 5. To link from a tagref to the associated unique tagid I use the "Find in Project" dialog. I type "tagid=<tagid>" and click the single link in the result to load the relevant file. 6. I love to have the following command: with the caret in a "tagref=<tagid>" reference and pushing the enter key, the relevant file automatically loads. 7. I have no idea how to make this command; help is appreciated.
Instead, I suggest using regular (relative) markdown links for your cross-references, and just using the regular syntax, as you would with any other links. That way, we can instead make a command which opens a general markdown link, either in the browser if it's an html page, or in an image editor/textmate if it's a local file. I've personally wanted such a command for a long time.
-Jacob
On Nov 7, 2006, at 9:23 AM, Jacob Rus wrote:
Bert Fitié wrote:
- I'm a happy (64-year old, retired) enduser of textmate, not a
programmer. 2. I'm using a textmate project as my "personal textbase". The project has many markdown files. I don't use markdown as a source to convert to html but as the real thing, as my final product (with an occasional preview for reading convenience). 3. My markdown file is a container for one or more articles, each about a separate topic. Every article is uniquely identified by a tag in the form of a string "tagid=<tagid>". 4. I'm using crossreferences to other articles in the form of a string "tagref=<tagid>". 5. To link from a tagref to the associated unique tagid I use the "Find in Project" dialog. I type "tagid=<tagid>" and click the single link in the result to load the relevant file. 6. I love to have the following command: with the caret in a "tagref=<tagid>" reference and pushing the enter key, the relevant file automatically loads. 7. I have no idea how to make this command; help is appreciated.
Instead, I suggest using regular (relative) markdown links for your cross-references, and just using the regular syntax, as you would with any other links. That way, we can instead make a command which opens a general markdown link, either in the browser if it's an html page, or in an image editor/textmate if it's a local file. I've personally wanted such a command for a long time.
-Jacob
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
I second your suggestion, it would be a nice addition to markdown.
The present <URL> construct in markdown cannot be used for regular local links since it does not allow local URLs like file:// or txmt://. Only internet links like http://.. or ftp://.. are supported.
This does, however, not solve my problem. Using a regular markdown link requires knowing the file that contains the relevant article. But I want the articles to be agnostic about their file container. When I reorganize my articles (for example, because they grow or shrink in size) I may combine them in the same file or put them in different files). Whatever I do, I don't want to update my links. That's the reason that I'm using a 'tagid' as identifier for an article and 'tagref' as reference and that I link on basis of a search (I don't know the file, only that it is in my project). So I still have good use for the proposed command and a need for "Find in Project" functionality for this command.
Am 7. Nov 2006 um 12:26 schrieb Bert Fitié:
Whatever I do, I don't want to update my links.
Sounds like what you would really want is some way of creating a wiki from your markdown-files? Then you could just browse via a web preview… not?
I bet there are wikis that work with text files…
Dan
On Nov 7, 2006, at 12:33 PM, Daniel Käsmayr wrote:
Am 7. Nov 2006 um 12:26 schrieb Bert Fitié:
Whatever I do, I don't want to update my links.
Sounds like what you would really want is some way of creating a wiki from your markdown-files? Then you could just browse via a web preview… not?
I bet there are wikis that work with text files…
Dan
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
I would rephrase your description "creating a wiki from markdown files" as "using fixed-links **in** markdown files". The markdown files are my 'endproduct', I'm happy with them and don't intend to convert them to anything (html or wiki). Web Preview I occasionally use for convenience of reading, but linking to an (article in an) other markdown file should be possible from the markdown files themselves.
-- Bert
Am 7. Nov 2006 um 12:47 schrieb Bert Fitié:
I would rephrase your description "creating a wiki from markdown files" as "using fixed-links **in** markdown files". The markdown files are my 'endproduct', I'm happy with them and don't intend to convert them to anything (html or wiki). Web Preview I occasionally use for convenience of reading, but linking to an (article in an) other markdown file should be possible from the markdown files themselves.
Well, if the wiki software would - on the fly convert your markdown files correctly to a web page with links from tag to tag… there would never be anything other than the markwdown file as source… and the wiki-view as viewer of those source files (structured in folders and linked with each other by tags)?
Dan
On Nov 7, 2006, at 12:58 PM, Daniel Käsmayr wrote:
Am 7. Nov 2006 um 12:47 schrieb Bert Fitié:
I would rephrase your description "creating a wiki from markdown files" as "using fixed-links **in** markdown files". The markdown files are my 'endproduct', I'm happy with them and don't intend to convert them to anything (html or wiki). Web Preview I occasionally use for convenience of reading, but linking to an (article in an) other markdown file should be possible from the markdown files themselves.
Well, if the wiki software would - on the fly convert your markdown files correctly to a web page with links from tag to tag… there would never be anything other than the markwdown file as source… and the wiki-view as viewer of those source files (structured in folders and linked with each other by tags)?
Dan
Ah, I see, an interesting idea, a wiki-viewer which leaves the markdown files "as-is" (in the same way as Web Preview leaves these files).
Linking by tags from the wiki-viewer is nice, but linking from the markdown files (without a need to go to the viewer first) should also be possible. Cp. the txmt:// link and Web Preview: the txmt link can be used both from Web Preview and from the markdown file.
How could such a wiki-viewer idea be implemented, a separate bundle, or an addition to the markdown bundle ?
-- Bert
Bert Fitié wrote:
I second your suggestion, it would be a nice addition to markdown.
The present <URL> construct in markdown cannot be used for regular local links since it does not allow local URLs like file:// or txmt://. Only internet links like http://.. or ftp://.. are supported.
Well, if you do a relative link, it will work fine for local stuff...
-Jacob
A relative link as a <URL> construct doesn't work in markdown, but in the [desc](URL) form it does; thanks for the tip.
It still leaves the point that I have to nominate a file in the relative link; with search-based linking (which I do manually right now with the "Find in Project" dialog since I don't have my command yet) I don't need a file name as long as the file is in my project.
-- Bert
On Nov 7, 2006, at 3:12 PM, Jacob Rus wrote:
Bert Fitié wrote:
I second your suggestion, it would be a nice addition to markdown. The present <URL> construct in markdown cannot be used for regular local links since it does not allow local URLs like file:// or txmt://. Only internet links like http://.. or ftp://.. are supported.
Well, if you do a relative link, it will work fine for local stuff...
-Jacob
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Bert Fitié wrote:
A relative link as a <URL> construct doesn't work in markdown, but in the [desc](URL) form it does; thanks for the tip.
It still leaves the point that I have to nominate a file in the relative link; with search-based linking (which I do manually right now with the "Find in Project" dialog since I don't have my command yet) I don't need a file name as long as the file is in my project.
Hmm, one way you could maybe get around this is to use reference style links, like [this][linkname], and then have a global list of references, that you stick at the bottom of each file, and can change across all your files. You can write a script to go through and update all the references at the bottom of the files, or you can use something like the tminclude stuff instead.
-Jacob
[linkname]: ../some_file_or_other.mdown
Interesting idea, Jacob, I will look into it.
I see a disadvantage with this solution. It will load the relevant file, but unless the article I'm linking to is the first (or only) one in the file and is at the top, I have to find it further down. My method (still manually, though) brings me direct to the "tagid=<tagid>" line which is the start of the article. Attaching line info to the URL is no option since it changes too often and is not maintainable.
-- Bert
On Nov 7, 2006, at 3:51 PM, Jacob Rus wrote:
Bert Fitié wrote:
A relative link as a <URL> construct doesn't work in markdown, but in the [desc](URL) form it does; thanks for the tip. It still leaves the point that I have to nominate a file in the relative link; with search-based linking (which I do manually right now with the "Find in Project" dialog since I don't have my command yet) I don't need a file name as long as the file is in my project.
Hmm, one way you could maybe get around this is to use reference style links, like [this][linkname], and then have a global list of references, that you stick at the bottom of each file, and can change across all your files. You can write a script to go through and update all the references at the bottom of the files, or you can use something like the tminclude stuff instead.
-Jacob
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Bert Fitié wrote:
Interesting idea, Jacob, I will look into it.
I see a disadvantage with this solution. It will load the relevant file, but unless the article I'm linking to is the first (or only) one in the file and is at the top, I have to find it further down. My method (still manually, though) brings me direct to the "tagid=<tagid>" line which is the start of the article. Attaching line info to the URL is no option since it changes too often and is not maintainable.
I don't actually understand what you mean here... If you hop onto IRC, we can more easily discuss this.
Your method gives a "tagid" to each file. I think we can do the same thing here, by making the reference name «refname» (as in [link text][«refname»]) essentially the tagID that you are using currently. The only difference is that a) this link will render correctly in the html, and 2) It's legal markdown syntax, as opposed to your system, which is a (rather arbitrary) extension.
So to summarize, you link all the documents using the reference names that you want to use as tag IDs, and then if you want, you can change where those references point to, and easily update those pointers at the bottom of every file, and voila, your problem is solved :). The only tricky bit then is figuring out how to get all the links at the bottom of each page to be updated. I think this will be easy enough to make in a simple little script. So what you end up with is one document which includes all of your link definitions, which match reference IDs up with file locations, and you include that document in every other document.
-Jacob
1. Jacob, thanks very much. With these suggestions I can satisfy my requirement in the following way without the need for a new command (which is a relief for me): 2. My "tagid=<tagid>" string which identifies (and indicates the beginning of) an article remains as it is. 3. The file and line of this string, however, I store in an easily maintainable central file (to be included in al my markdown files via tminclude) in the following way: [<tagid>]: txmt-url-with-file-and-line 4. My "tagref=<tagid>" string I change into "tagref=[<tagid>][] using markdown's implicit link name short cut 5. I tested it out and it works, both form the markdown file itself and from the preview.
-- Bert
On Nov 7, 2006, at 4:47 PM, Jacob Rus wrote:
Bert Fitié wrote:
Interesting idea, Jacob, I will look into it. I see a disadvantage with this solution. It will load the relevant file, but unless the article I'm linking to is the first (or only) one in the file and is at the top, I have to find it further down. My method (still manually, though) brings me direct to the "tagid=<tagid>" line which is the start of the article. Attaching line info to the URL is no option since it changes too often and is not maintainable.
I don't actually understand what you mean here... If you hop onto IRC, we can more easily discuss this.
Your method gives a "tagid" to each file. I think we can do the same thing here, by making the reference name «refname» (as in [link text][«refname»]) essentially the tagID that you are using currently. The only difference is that a) this link will render correctly in the html, and 2) It's legal markdown syntax, as opposed to your system, which is a (rather arbitrary) extension.
So to summarize, you link all the documents using the reference names that you want to use as tag IDs, and then if you want, you can change where those references point to, and easily update those pointers at the bottom of every file, and voila, your problem is solved :). The only tricky bit then is figuring out how to get all the links at the bottom of each page to be updated. I think this will be easy enough to make in a simple little script. So what you end up with is one document which includes all of your link definitions, which match reference IDs up with file locations, and you include that document in every other document.
-Jacob
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate