Shortcut : Format selected text into brackets (or parenthesis, or eventually quotes)


#1

Hello there,

I was doing some import in Dynalist, through some OPML format files, exported from Workflowy & some Mindmapping softwares i have.

The problem is that the hyperlinks appear into parenthesis, but not embedded in the URL description text, which are not into brackets in an OPML 2.0 file:
"URL description text (http:www.example.com)" instead of "[URL description text](http:www.example.com)"

For now i found kind of a solution :

  • Copy/paste all the exported OPML code into an online OPML viewer
  • Make it “Beautify”, to make it neater, and Copy/Paste all into Sublime (if, as i do, you don’t know how to do it directly into Sublime :slight_smile: )
  • If the code is in OPML 1.0
    ** Replace all " type="link" url=" by nothing, & <opml version="1.0">by <opml version="2.0">)
    ** Put all the URLs into parenthesis, by text selecting them and then press the key to open a parenthesis (5 in Mac OS)
  • Otherwise, just put all the URL Description Text into brackets, by text selecting them & then press the keys to open a bracket (Opt/Alt + Shift/Maj + 5 in Mac OS)
  • Finally, Copy/paste all the code into the Dynalist document you want, and ii should normally work (it did for me).

Now my question is :

  • Could it be possible to do the same kind of shortcut bracket/parenthesis formatting, described above, but directly into Dynalist ?
    ** Is there a markdown shortcut i could use in Dynalist but which i am unaware of ?
    ** Could it be manageable with some CSS Custom code to add ?
    ** Any other tips, advices or solutions ?

This could save a lot of time to users, i guess, especially to those who are migrating content from other platforms into Dynalist, as i am doing right now.

Thanks in advance & have a good One !

PS: I put this topic into help, but if ever there is actually no solution to this matter in Dynalist, don’t hesitate to classify it into #features finally. It could be in the same flavor of shortcut than the bold, italics, strikethrough, code & LaTex, as they all apply that formatting onto selected text already.


#2

May I ask where did you export this OPML format from? In the most likely case, the best way is to write a script (python, nodejs, or other) that parses the OPML and does the replacement automatically, then import into Dynalist. I would recommend posting a sample OPML so people could help you with it.


#3

Hi Shida,

The OPML format i had to process as mentionned before come from iThoughtsX exports.
The OPML is v1.0 only, which is a pain in the ass when you want to transfer the hyperlinks from within the mindmaps toward Dynalist.

Concerning the Python/nodejs/automator(?)… scripts i have in mind the algorithm, for sure, but no idea how to implement it, as i don’t practice coding in a daily basis.

Below is an example of the kind of structure i would like to import efficiently with the least manual treatment possible for most of the elements (Notes, URL, links…)

<opml version="1.0"> <head> <title>Idée centrale</title> </head> <body> <outline text="Sujet 1" _note="Notes Sujet 1"> <outline text="Sous sujet 1.1" type="link" url="folder/subfolder/file.ext"></outline> </outline> <outline text="Sujet 2" _note="Notes Sujet 2"> <outline text="Sous sujet 2.1" type="link" url="http://www.linkss21.com"> <outline text="Sous sous sujet 2.1.1" type="link" url="mailto:machin@truc.com"></outline> <outline text="Sous sous sujet 2.1.2" type="link" url="http://linkssj212.com"></outline> </outline> <outline text="Sous sujet 2.2" _note="Notes sous sujet 2.2"></outline> </outline> <outline text="Sujet 3"> <outline text="Sous sujet 3.1" _note="Notes Sous sujet 3.1" type="link" url="http://www.linksj31.com"></outline> </outline> <outline text="Sujet 4"> <outline text="Légende"> <outline text="Sous légende 1" _note="Notes Sous légende 1"></outline> <outline text="Sous légende 2" type="link" url="http://www.linksleg2.com"></outline> </outline> </outline> </body> </opml>

Thanks in advance if you have any clues, and even better any procedure to suggest to me ! :slight_smile:
Have all a good One,

Damien


#4

Here’s what I whipped up in 5 minutes:

Go to https://regexr.com/
Change the expression to

text="([^"]*)"(\s*_note="[^"]*")*\s*type="link"\s*url="([^"]*)"

Place your OPML inside the “Text” section.
Choose “Replace” in tools.
Use this as the replacement:

text="[$1]($3)"$2

You should see the result like this:


#5

Ok Thanks very much Shida for the Christmas gift !! :slight_smile:
I tested it and copy/paste the result into Dynalist : Works perfectly ! \°/