deanishe Posted March 9, 2014 Share Posted March 9, 2014 I'm using this workflow so much. Absolutely brilliant idea! Link to comment
vitor Posted April 12, 2014 Author Share Posted April 12, 2014 Update. Headers are now bold, in addition to the increased size. Link to comment
vdesabou Posted April 23, 2014 Share Posted April 23, 2014 Hi Vitor, I've updated to latest release but now I have issues with the file I'm working on https://raw.github.com/vdesabou/alfred-spotify-mini-player/master/README.md I believe it was working fine before, can you see what's wrong? The output is broken, see #1 Thanks! Link to comment
vitor Posted April 24, 2014 Author Share Posted April 24, 2014 Headers were removing the line below, which in turn was messing up lists, which was causing your problem. The new version fixes this, it should now work correctly for your case. I’ve also removed alleyoop support. vdesabou 1 Link to comment
Simolinic Posted July 27, 2014 Share Posted July 27, 2014 (edited) This workflow is fantastic! Thank you so much for putting it together. There's one feature of Markdown (at least as it's implemented in FoldingText) for putting Comments inside {>> <<}. Usually, when Exporting, these comments are omitted. I really like leaving lots of notes for myself inside Comments while typing, but would like to be able to use this Workflow to copy the text without the Comments. I'm not very well-informed about regexp. I thought maybe I could just replace any instance of {>> ... <<} with an empty ''. But I don't really know how to even do this. This was my attempted modification, which obviously doesn't work: s = s.gsub /\{\<\<(\S.*?)\>\>\}/, ' ' Hopefully that shows what I'm aiming for? What did I get wrong here? Thanks again! Edited July 27, 2014 by Simolinic Link to comment
vitor Posted July 27, 2014 Author Share Posted July 27, 2014 (edited) Thank you for the kind words. On to your problem. You’re escaping too much: you don’t actually need to escape any of the characters, as they’re not special (the ones that are need to be there unescaped, anyway). You’re also trying to substitute for a space (' '), when you should be substituting by nothing (''). When you say (\S.*?), what you’re saying is “capture one non-whitespace character, followed by any character zero or more times, until it finds your closing condition”. You don’t need capturing, or the non-whitespace definition. You were on the right track, just needed to remove the extra stuff. You said it should take into account text between {>> and <<}, but your example is showing something different (between {<< and >>}. I’ll take your first reference as guide. The line should read s = s.gsub /{>>.*?<<}/m, '' The m means you can have multi-line comments.Keep in mind this solution substitutes by nothing (meaning “something empty”, as opposed to deleting), so if you have a comment by itself on a line, it will still leave an empty line. On a tangent note, I recommend rubular to test out ruby regular expressions in real time. Edited August 4, 2014 by Vítor Simolinic 1 Link to comment
Simolinic Posted July 27, 2014 Share Posted July 27, 2014 Awesome! Thanks, Vitor. Obviously I was silly to have flipped my << and my >>. I admit to a little bit of regexp dazzle, getting all turned around just trying to understand them at all. Your new line is exactly what I needed! Thank you, my friend. Link to comment
vitor Posted August 12, 2014 Author Share Posted August 12, 2014 Update.Added footnote support. Those aren’t really supported in BBCode, so there are some liberties with how they’re presented. You define them by setting something like [^1] in your text, and then again at the end of it (with a preceding blank line). The ones at the bottom should have no blank lines between them, as on conversion they’ll be added, as well as a line separating footnotes from the rest of the text. If we have a text[^1] like this[^2]. With multiple lines and footnotes. [^1] It will be converted. [^2] To something a bit more readable. If we have a text1 like this2.With multiple lines and footnotes.——————————1 It will be converted.2 To something a bit more readable. Link to comment
smarg19 Posted August 12, 2014 Share Posted August 12, 2014 It seems it would be fairly trivial to add the converse BBCode to Markdown functionality. I, for one, would use that alot. Link to comment
vitor Posted August 13, 2014 Author Share Posted August 13, 2014 Yes, it would be somewhat trivial, but also somewhat time consuming. I, for one, believe you’re an isolated case in this, so I don’t intend to add support for it (the reason I’ve built this in the first place is that I find BBCode awful to write). I’ll gladly give you some help with transforming it, though. You should be able to do it with no understanding of ruby and some understanding of regular expressions. It might also not be as simple as it looks at first. I took some liberties in interpreting certain transformations — transformations that can translate well from markdown to BBCode, but not the reverse. For example, in setting up headers, since they don’t exist in BBCode, I’ve picked a few of the markdown header sizes (from the available 6) and while converting what I do is make the text bold and increase its size to a number I’ve picked (from the available theoretically infinite1). Right now, if you’re unhappy with the sizes I’ve picked (or even the bold, as you might prefer them in italic, for example) its relatively easy to simply open the substitutions file, and change them to end up like you want2.Now, how would we do the reverse? How would we define which combination of styles and sizes correspond to each header? Sure, it can be done, but it would take an insane amount os personal opinion and styling preference. I make it easy for you to edit the substitutions, but I also try to make very good defaults so you don’t feel a need to. Thats exponentially hard with the reverse system, because there are so many variations, no set of assumptions should satisfy most cases without the need for tweaking.Markdown → BBCode means what you’ve used somewhere else could be transformed (and easily tweaked) without modifying the original content. BBCode → Markdown means dictating how you need to structure your content to get the desired result. It works the way it is currently because markdown has structure where BBCode only has styling declarations. A markdown header (likely) means you want your text bigger, but defining bigger text in BBCode does not mean you want a header. Structure → styling makes sense, styling → structure not so much.——————————1 Is there a size limit? Even if there is, it’s definitely higher than 6.2 That’s a design decision present from the start. the workflow’s structure itself is influenced by this idea of making it easy to modify the substitutions that were driven by my opinions. Link to comment
Don Dahl Posted August 14, 2014 Share Posted August 14, 2014 Hi Vitor. Just discovered this workflow. Is there a way for you to show the different conversions supported inside alfred? Im not savvy with markdown so i have to have this workflow page open as docu lol. Thanks for this! Link to comment
vitor Posted August 14, 2014 Author Share Posted August 14, 2014 I don't plan on adding such a feature, I'm afraid. There are already workflows geared up for that type of functionality (Cheaters; Quick Ref), so I have no intention of duplicating that functionality. You should be able to easily find a markdown cheat sheet online, to keep the syntax always at hand. Don Dahl 1 Link to comment
vitor Posted November 14, 2015 Author Share Posted November 14, 2015 Update. Better handling of bold and italic inside links. Link to comment
vitor Posted April 15, 2016 Author Share Posted April 15, 2016 (edited) Update. Ever noticed that stupid non-breaking whitespace forum software automatically adds to your empty lines? Gone! That space could sometimes confuse the other transformations (particularly quotes), so hopefully they’ll now work more reliably. Footnotes are now separated by a full horizontal line instead of dashes. Inline code now has a background color. Don’t worry if you see some tags in your preview. The forum software may not interpret them in the preview, but it will display them after posting. Edited April 15, 2016 by Vítor Link to comment
vitor Posted June 10, 2016 Author Share Posted June 10, 2016 (edited) Update. Footnotes at the end now are of the form [^1]:. Edited June 10, 2016 by Vítor Link to comment
vitor Posted July 10, 2016 Author Share Posted July 10, 2016 Update. It now uses OneUpdater, so this should be the last time you need to manually update. Link to comment
vitor Posted September 28, 2016 Author Share Posted September 28, 2016 Update. By default, for inline code, use Courier instead of Courier New. To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
nikivi Posted September 28, 2016 Share Posted September 28, 2016 Speaking of OneUpdater, it is really awesome. I wish more workflows implemented it. The only thing I am curious about though is why WebScreenshot updates so often? Link to comment
vitor Posted September 28, 2016 Author Share Posted September 28, 2016 2 minutes ago, nikivi said: Speaking of OneUpdater, it is really awesome. I wish more workflows implemented it. Thank you for the kind words. I’m pretty confident OneUpdater isn’t that well known, so if you’d like to see it implemented more broadly (though it is meant to be versatile enough for you to implement it yourself in other people’s workflows), you should ask the developers to do so. If any has any questions, I’m available to answer. 2 minutes ago, nikivi said: The only thing I am curious about though is why WebScreenshot updates so often? All updates are documented on the post. Long story short(er), it uses an external tool to upload the images to imgur. The original tool had a few issues, so I contributed upstream and worked with the author to fix them. As I found those issues with the tool and fixed them, WebScreenshot needed to be updated as well, naturally. Recently, however, as issues kept popping up for no discernible reason, I decided for various reasons the tool was just too broken and it wasn’t worth it to keep fixing it, so I changed it. With the change to a new tool, however, some implementation details changed, so I need to fix those as well. This new tool also as some minor issues I’m in the process of fixing. It’s better to have the workflow be made robuster regularly than just waiting and bottling up a lot of updates, especially since I have so many released workflows, sometimes they’re hard to keep track of. Link to comment
nikivi Posted September 28, 2016 Share Posted September 28, 2016 (edited) Oh, this makes sense then. Thank you for the updates. There is an issue though. It seems the urls I get, have a space at the end of it, so for example, I make a screenshot and try and paste it here : The above, after pasting, will become this : I have to press delete every time after pasting. Can you help fix this issue? Thank you. Edited September 28, 2016 by nikivi Link to comment
vitor Posted September 28, 2016 Author Share Posted September 28, 2016 That newline problem is one of the new issues with changing to the new tool and I’ve already fixed it earlier today. Link to comment
vitor Posted October 7, 2016 Author Share Posted October 7, 2016 Updated to use the most recent version of OneUpdater. Link to comment
vitor Posted October 28, 2016 Author Share Posted October 28, 2016 Update. Counter IPBoard's collapse of empty lines. To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
vitor Posted October 30, 2016 Author Share Posted October 30, 2016 (edited) Update. No longer use auto:0 in code blocks. To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Edited October 30, 2016 by vitor Link to comment
vitor Posted November 7, 2016 Author Share Posted November 7, 2016 Update. Don't start and end quotes with newlines. To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now