[tw] Re: [TW5] Presenting Klugey HTML to TW5 converter
Hi Guys, Works really very well, considering the HTML-export I throw at it. I have to do some extra work on the result but then it is great and looksfine in my TW. I have about 2000 items in the database that slowly I am converting to items in a TW Thanks a bunch!! Salut! Edm. = Op zaterdag 26 maart 2016 00:32:37 UTC+1 schreef Mark S.: > > This is really kind of klugey (sp?) but it gets you (or at least me) about > 90% of the way towards turning HTML from web pages into TW5 mark-up. It > attempts to convert most common markups including links, images and tables. > > Someone who understood TW5 better would probably build a DOM tree > structure, and then parse out the parts piece by piece. > > What I did was to simply apply a series of regular expressions. The > problem with this approach is that mismatched tags can really throw the > translation off the rails. So use at your own risk. You should check to > make sure that all original content is still present. You are likely to > need to adjust bullets and tables. It's likely that certain situations I > haven't thought of will break it more severely. > > Maybe this will be an incentive for someone to come up with something > better ;-) > > As always, make sure that you have a backup of any TW you try this in. > Just import the attached json and then reload your TW file. Put your HTML > contents in a designated tiddler. In the HTML2TW Launcher supply the name > of the source tiddler and click on the convert button. The resulting > mark-up should appear in the tiddler with the same name as the original > tiddler plus "-converted" appended to the title.. > > Thanks to BJ, Eric, and Jed for helping me with the launcher. > > Mark > > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/63f7c099-beb7-4179-87c9-fa150e61e319%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: [TW5] Presenting Klugey HTML to TW5 converter
Good stuff Mark. I will put a link to it in the next release of tiddlyclip.. -bj On Tuesday, March 29, 2016 at 12:50:43 AM UTC+1, Mark S. wrote: > > Hi BJ, > > That's pretty neat! > > Here's the macro with your suggested changes, the $:/tags/tiddlyclip > flag, some attribution, disclaimer, and a bit of documentation. > > If you want to include it in your distribution that's OK by me. > > Thanks! > Mark > > On Saturday, March 26, 2016 at 11:12:58 AM UTC-7, BJ wrote: >> >> oops! your macro needs to be tagged $:/tags/tiddlyclip in order that tc >> can find it. >> >> On Saturday, March 26, 2016 at 5:37:52 PM UTC, Mark S. wrote: >>> >>> Hi BJ, >>> >>> That sounds like a really good idea. But when I try it, it gives an >>> alert pop-up that says "html2twmarco not found". ("marco" is an exact >>> quote). >>> >>> Is there something else I have to do to the macro (naming, location, >>> tagging?) to allow it to be found? >>> >>> Thanks! >>> Mark >>> >>> On Saturday, March 26, 2016 at 3:40:05 AM UTC-7, BJ wrote: Hi Mark, good stuff!. You marco seem to work to a large extend. I wrote a similar one to convert to html to tw2, and had about the same success, for reference it is here http://tiddlyclip.tiddlyspot.com/#%24%3A%2Fplugins%2Fbj%2Ftiddlyclip%2Fconvert.js If you make a small change in your code you can call the macro from a tiddlyclip rule. The change is /* Check for special environmental variable. But argument text will take precedence. */ var vartext = (this && this.getVariable) ? this.getVariable("text2convert"): null; if (vartext) intext = vartext ; The tiddlyclip tiddlers are below, and allow content to be converted as it is clipped. All the best BJ On Friday, March 25, 2016 at 11:32:37 PM UTC, Mark S. wrote: > > This is really kind of klugey (sp?) but it gets you (or at least me) > about 90% of the way towards turning HTML from web pages into TW5 > mark-up. > It attempts to convert most common markups including links, images and > tables. > > Someone who understood TW5 better would probably build a DOM tree > structure, and then parse out the parts piece by piece. > > What I did was to simply apply a series of regular expressions. The > problem with this approach is that mismatched tags can really throw the > translation off the rails. So use at your own risk. You should check to > make sure that all original content is still present. You are likely to > need to adjust bullets and tables. It's likely that certain situations I > haven't thought of will break it more severely. > > Maybe this will be an incentive for someone to come up with something > better ;-) > > As always, make sure that you have a backup of any TW you try this in. > Just import the attached json and then reload your TW file. Put your HTML > contents in a designated tiddler. In the HTML2TW Launcher supply the name > of the source tiddler and click on the convert button. The resulting > mark-up should appear in the tiddler with the same name as the original > tiddler plus "-converted" appended to the title.. > > Thanks to BJ, Eric, and Jed for helping me with the launcher. > > Mark > > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/095abd51-d515-4fd2-afd7-c6682528c5bc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: [TW5] Presenting Klugey HTML to TW5 converter
Hi BJ, That's pretty neat! Here's the macro with your suggested changes, the $:/tags/tiddlyclip flag, some attribution, disclaimer, and a bit of documentation. If you want to include it in your distribution that's OK by me. Thanks! Mark On Saturday, March 26, 2016 at 11:12:58 AM UTC-7, BJ wrote: > > oops! your macro needs to be tagged $:/tags/tiddlyclip in order that tc > can find it. > > On Saturday, March 26, 2016 at 5:37:52 PM UTC, Mark S. wrote: >> >> Hi BJ, >> >> That sounds like a really good idea. But when I try it, it gives an alert >> pop-up that says "html2twmarco not found". ("marco" is an exact quote). >> >> Is there something else I have to do to the macro (naming, location, >> tagging?) to allow it to be found? >> >> Thanks! >> Mark >> >> On Saturday, March 26, 2016 at 3:40:05 AM UTC-7, BJ wrote: >>> >>> Hi Mark, >>> good stuff!. You marco seem to work to a large extend. I wrote a similar >>> one to convert to html to tw2, and had about the same success, for >>> reference it is here >>> >>> >>> http://tiddlyclip.tiddlyspot.com/#%24%3A%2Fplugins%2Fbj%2Ftiddlyclip%2Fconvert.js >>> >>> If you make a small change in your code you can call the macro from a >>> tiddlyclip rule. The change is >>> >>> /* Check for special environmental variable. But argument text will take >>> precedence. */ >>> var vartext = (this && this.getVariable) ? >>> this.getVariable("text2convert"): null; >>> if (vartext) intext = vartext ; >>> >>> >>> The tiddlyclip tiddlers are below, and allow content to be converted as >>> it is clipped. >>> >>> All the best >>> BJ >>> >>> >>> >>> >>> On Friday, March 25, 2016 at 11:32:37 PM UTC, Mark S. wrote: This is really kind of klugey (sp?) but it gets you (or at least me) about 90% of the way towards turning HTML from web pages into TW5 mark-up. It attempts to convert most common markups including links, images and tables. Someone who understood TW5 better would probably build a DOM tree structure, and then parse out the parts piece by piece. What I did was to simply apply a series of regular expressions. The problem with this approach is that mismatched tags can really throw the translation off the rails. So use at your own risk. You should check to make sure that all original content is still present. You are likely to need to adjust bullets and tables. It's likely that certain situations I haven't thought of will break it more severely. Maybe this will be an incentive for someone to come up with something better ;-) As always, make sure that you have a backup of any TW you try this in. Just import the attached json and then reload your TW file. Put your HTML contents in a designated tiddler. In the HTML2TW Launcher supply the name of the source tiddler and click on the convert button. The resulting mark-up should appear in the tiddler with the same name as the original tiddler plus "-converted" appended to the title.. Thanks to BJ, Eric, and Jed for helping me with the launcher. Mark -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/31678c68-c1fe-4c1d-b9e3-1e5d02fac690%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. HTML2TW_ Macro_v0-1.json Description: application/json
[tw] Re: [TW5] Presenting Klugey HTML to TW5 converter
oops! your macro needs to be tagged $:/tags/tiddlyclip in order that tc can find it. On Saturday, March 26, 2016 at 5:37:52 PM UTC, Mark S. wrote: > > Hi BJ, > > That sounds like a really good idea. But when I try it, it gives an alert > pop-up that says "html2twmarco not found". ("marco" is an exact quote). > > Is there something else I have to do to the macro (naming, location, > tagging?) to allow it to be found? > > Thanks! > Mark > > On Saturday, March 26, 2016 at 3:40:05 AM UTC-7, BJ wrote: >> >> Hi Mark, >> good stuff!. You marco seem to work to a large extend. I wrote a similar >> one to convert to html to tw2, and had about the same success, for >> reference it is here >> >> >> http://tiddlyclip.tiddlyspot.com/#%24%3A%2Fplugins%2Fbj%2Ftiddlyclip%2Fconvert.js >> >> If you make a small change in your code you can call the macro from a >> tiddlyclip rule. The change is >> >> /* Check for special environmental variable. But argument text will take >> precedence. */ >> var vartext = (this && this.getVariable) ? >> this.getVariable("text2convert"): null; >> if (vartext) intext = vartext ; >> >> >> The tiddlyclip tiddlers are below, and allow content to be converted as >> it is clipped. >> >> All the best >> BJ >> >> >> >> >> On Friday, March 25, 2016 at 11:32:37 PM UTC, Mark S. wrote: >>> >>> This is really kind of klugey (sp?) but it gets you (or at least me) >>> about 90% of the way towards turning HTML from web pages into TW5 mark-up. >>> It attempts to convert most common markups including links, images and >>> tables. >>> >>> Someone who understood TW5 better would probably build a DOM tree >>> structure, and then parse out the parts piece by piece. >>> >>> What I did was to simply apply a series of regular expressions. The >>> problem with this approach is that mismatched tags can really throw the >>> translation off the rails. So use at your own risk. You should check to >>> make sure that all original content is still present. You are likely to >>> need to adjust bullets and tables. It's likely that certain situations I >>> haven't thought of will break it more severely. >>> >>> Maybe this will be an incentive for someone to come up with something >>> better ;-) >>> >>> As always, make sure that you have a backup of any TW you try this in. >>> Just import the attached json and then reload your TW file. Put your HTML >>> contents in a designated tiddler. In the HTML2TW Launcher supply the name >>> of the source tiddler and click on the convert button. The resulting >>> mark-up should appear in the tiddler with the same name as the original >>> tiddler plus "-converted" appended to the title.. >>> >>> Thanks to BJ, Eric, and Jed for helping me with the launcher. >>> >>> Mark >>> >>> -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4cdb9345-db2f-4af1-ae9d-4451bdc287cf%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: [TW5] Presenting Klugey HTML to TW5 converter
Hi BJ, That sounds like a really good idea. But when I try it, it gives an alert pop-up that says "html2twmarco not found". ("marco" is an exact quote). Is there something else I have to do to the macro (naming, location, tagging?) to allow it to be found? Thanks! Mark On Saturday, March 26, 2016 at 3:40:05 AM UTC-7, BJ wrote: > > Hi Mark, > good stuff!. You marco seem to work to a large extend. I wrote a similar > one to convert to html to tw2, and had about the same success, for > reference it is here > > > http://tiddlyclip.tiddlyspot.com/#%24%3A%2Fplugins%2Fbj%2Ftiddlyclip%2Fconvert.js > > If you make a small change in your code you can call the macro from a > tiddlyclip rule. The change is > > /* Check for special environmental variable. But argument text will take > precedence. */ > var vartext = (this && this.getVariable) ? > this.getVariable("text2convert"): null; > if (vartext) intext = vartext ; > > > The tiddlyclip tiddlers are below, and allow content to be converted as it > is clipped. > > All the best > BJ > > > > > On Friday, March 25, 2016 at 11:32:37 PM UTC, Mark S. wrote: >> >> This is really kind of klugey (sp?) but it gets you (or at least me) >> about 90% of the way towards turning HTML from web pages into TW5 mark-up. >> It attempts to convert most common markups including links, images and >> tables. >> >> Someone who understood TW5 better would probably build a DOM tree >> structure, and then parse out the parts piece by piece. >> >> What I did was to simply apply a series of regular expressions. The >> problem with this approach is that mismatched tags can really throw the >> translation off the rails. So use at your own risk. You should check to >> make sure that all original content is still present. You are likely to >> need to adjust bullets and tables. It's likely that certain situations I >> haven't thought of will break it more severely. >> >> Maybe this will be an incentive for someone to come up with something >> better ;-) >> >> As always, make sure that you have a backup of any TW you try this in. >> Just import the attached json and then reload your TW file. Put your HTML >> contents in a designated tiddler. In the HTML2TW Launcher supply the name >> of the source tiddler and click on the convert button. The resulting >> mark-up should appear in the tiddler with the same name as the original >> tiddler plus "-converted" appended to the title.. >> >> Thanks to BJ, Eric, and Jed for helping me with the launcher. >> >> Mark >> >> -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/cb589349-140e-4d21-a84d-792ead8e4c1a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: [TW5] Presenting Klugey HTML to TW5 converter
Hi Mark, good stuff!. You marco seem to work to a large extend. I wrote a similar one to convert to html to tw2, and had about the same success, for reference it is here http://tiddlyclip.tiddlyspot.com/#%24%3A%2Fplugins%2Fbj%2Ftiddlyclip%2Fconvert.js If you make a small change in your code you can call the macro from a tiddlyclip rule. The change is /* Check for special environmental variable. But argument text will take precedence. */ var vartext = (this && this.getVariable) ? this.getVariable("text2convert"): null; if (vartext) intext = vartext ; The tiddlyclip tiddler are below, and allows content to be converted as it is clipped. All the best BJ On Friday, March 25, 2016 at 11:32:37 PM UTC, Mark S. wrote: > > This is really kind of klugey (sp?) but it gets you (or at least me) about > 90% of the way towards turning HTML from web pages into TW5 mark-up. It > attempts to convert most common markups including links, images and tables. > > Someone who understood TW5 better would probably build a DOM tree > structure, and then parse out the parts piece by piece. > > What I did was to simply apply a series of regular expressions. The > problem with this approach is that mismatched tags can really throw the > translation off the rails. So use at your own risk. You should check to > make sure that all original content is still present. You are likely to > need to adjust bullets and tables. It's likely that certain situations I > haven't thought of will break it more severely. > > Maybe this will be an incentive for someone to come up with something > better ;-) > > As always, make sure that you have a backup of any TW you try this in. > Just import the attached json and then reload your TW file. Put your HTML > contents in a designated tiddler. In the HTML2TW Launcher supply the name > of the source tiddler and click on the convert button. The resulting > mark-up should appear in the tiddler with the same name as the original > tiddler plus "-converted" appended to the title.. > > Thanks to BJ, Eric, and Jed for helping me with the launcher. > > Mark > > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c780911f-5a49-4c31-a8c6-e64d3971a8ba%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. tiddlers(1).json Description: application/json