Use a more standard flavor of markdown

As Logseq uses # for bullets, integration with other markdown editors/viewers is not great (e.g. GitJournal). A more standard flavor (using * or - for bullet points would help)

We’d like to support this soon! Hopefully in the coming weeks, after the desktop app is out.

7 Likes

Hi @andrea, can you elaborate on the behavior you want? Logseq isn’t (just) a markdown editor, and its functionality includes syntax that will not be properly parsed by any markdown editors, such as ((block references)). Currently, blocks are marked by bullets, but you can also add bullets inside a block using + or * or -. And “standard flavor” is pretty subjective - what did you have in mind?

I am 100% in support of this, and would love to see it implemented. Using “-” (like Obsidian / Remnote) instead of “#” would allow to copy the text in another editor (Word, Wordpress, Notepad, GH etc.") and it would appear in a easier to manage format.

I am not sure of the flip side and limitation of what this would mean with other features though.

3 Likes

Hi @Cobblepot, fully agree that a standard markdown won’t be completely achievable.

The reason I’m not a fan of “#” is that it’s the syntax for headers is markdown, so markdown notes would look always look terrible.

Regarding block references, I don’t think there will be any easy way to show them, however a ((some_random_id_here)) in the middle of the note is not as problematic as having everything as a H2 header

3 Likes

+1 on this.

I use Obsidian alongside Logseq, and I am not a fan of the hashtag markdown on bullets in Logseq since bringing in my notes to Obsidian turns them into headings. Using - or * with indentions would be muuuuuuch better as it would directly translate to obsidian… Of course certain things like references wont carry over, but at least letting the basic outline structure be easily portable would be a huge help :slight_smile:

2 Likes

from @tienson the main dev and creator of logseq :

Why logseq support headings as bullets instead of unordered lists? The reason is that I started logseq as a side project for my own usage, I added org mode as the first markup support, most features like properties, todo keywords, and priorities only work with headings in org mode, that’s why we’re using headings instead of lists for bullets. I know that it’s very inconvenient to work with other editors and We’ll try to resolve this issue in the future.

sharing this script as a temporary workaround to convert from logseq to more standard md for obsidian/typora/etc :

# convert logseq to md
for file in *.md **/*.md **/**/*.md 
do
	# filepath="$file"
	file_name=$(basename "$file")
	echo "PROCESSING $file..."
	queryb='#+BEGIN_QUERY'
	querye='#+END_QUERY'
	sed -i 's/##########/\t\t\t\t\t\t\t-/' $file
	sed -i 's/#########/\t\t\t\t\t\t-/' $file
	sed -i 's/########/\t\t\t\t\t-/' $file
	sed -i 's/#######/\t\t\t\t-/' $file
	sed -i 's/######/\t\t\t-/' $file
	sed -i 's/#####/\t\t-/' $file
	sed -i 's/####/\t-/' $file
	sed -i 's/###/-/' $file
	# sed -i 's/##//' $file
	sed -i 's/:PROPERTIES:/<!--/' $file
	sed -i 's/:END:/-->\n/' $file
	sed -i 's/{{{embed /#relink-embed <!--/' $file
	sed -i 's/((/#relink-block [[/' $file
	sed -i 's/))/]]/' $file
	sed -i 's/{{{/#relink <!--/' $file
	sed -i 's/}}}/-->/' $file
	sed -i 's/{{/#relink <!--/' $file
	sed -i 's/}}/-->/' $file
	sed -i "s/$queryb/<!--$queryb/" $file
	sed -i "s/$querye/$query-->\n\n/" $file
done

I’m using it with zsh in Windows WSL but I suppose it should work in bash too.

  • it transforms: ### to tab+- and subsequents # add more tabs.
  • the base ## is untouched so it will look like a <H2>, depending on your workflow, you might want to uncomment the sed line
  • :PROPERTIES: .... :END: are replaced by comments <!-- (...) --->
  • embeds are replaced by a tag #relink-embed + comments to preserve the id for manual relinking
  • block refs : added #relink-block tag and turned into [[id]] : it needs manual relinking
  • queries are converted to comments (enclosed in <!-- -->)

!! warning: don’t run on your repo - make a copy first (this is not a 2-way converter) !!

usage:

. save the code as convertlogseq.sh
. create a \process folder and copy your logseq md files into \process
. put the script convertlogseq.sh in the \process folder
. open terminal, go to \process, run ./convertlogseq.sh
. it should process all .md files in \process + subdirectories recursively (it will throw error messages if there are no subfolders but it should be ok)

PS: the script is very crude, if you know how tyo improve it, please share

5 Likes

adding a snapshot of a converted logseq files inside obsidian (the graph is the logseq repo inside obsidian with some obsidian files mixed-in)

interestingly, the front matter tags are recognized as metadata in obsidian, even though the syntax is not the same (in obsi, page-tags are enclosed in brackets : tags: [tag1, tag2, tag3]) , so you can click the tags. comments are hidden in viewing mode but they are accessible in edit mode.

A need a way to convert nested page-links to get a correct graph though…
transforming [[page1 [[page2]]]] into [[page1.page2]] [[page2]] would be enough, but I don’t know how to proceed…

any suggestions ?

2 Likes

I’ll also add my vote here. Having .me files that are readable across apps would be great. Understood that some elements will be Logseq specific, but the core text readability - and portability - would be greatly enhanced by changing the behavior away from # tags populating notes

1 Like

Thanks for the tip @cannibalox!

Had to do a small edit to make it work on Mac OS / posting it if anyone else stumble across this post.

I had to replace sed -i with sed -i '' -e => background as to why in this stack overflow post.

Also (for the uninitiated) one step missing to the steps above, granting permission with chmod +x ./convertlogseq.sh

2 Likes

For the non-technical, can I get some hand-holding with this? :joy:

Hi Mina, you might be better off waiting for a few days (hopefully) as the markdown’s unordered list support is about to be released, although possibly not until next month.

Here is a video of how it might look and the link to the announcement:

This should allow you to easily copy and paste text without the ## being there

Hopefully this is what you were after

Edit: correction on dates

3 Likes

Hi @Ed_Nico Thanks for your reply.

To clarify, would this be in relation to converting my Obsidian.md daily notes into Logseq with the correct formatting? I would like to convert my notes but need some help. :slight_smile:

@Mina0824 it should work both ways.
Instead of using headers (#) for bullet points, Logseq will use (-) like Obsidian.

That way, there shouldn’t be the need of any conversion between Obsidian and Logseq (with the exception for block properties, block references and front matter)

Hi @andrea Thank you for this. So you also recommend that I wait. That a conversion with be unnecessary in the coming days?

I would also love normal Markdown formatting supported.

To add another use case to the ring, I love the fact that Logseq can be synced to a GitHub rep as normal Markdown files, because this allows me to edit the files from my text editor at times. For example, I currently want to go through all of my TODOs and mark them with the “#skipped” hashtag, which is a lot easier to do with my editor’s global find-and-replace tool. Basically I get the immense power of Logseq for connecting my thoughts AND the immense text editing power of VSCode all at once. It’s a dream!

Is this something I could help with? It sounds like it’s already in the works so I don’t want to step on anyone’s toes, but if there’s anything I can help with on the development side just let me know!

3 Likes

UPDATE: This is now supported as of the release that came out a few days ago! :partying_face:

3 Likes

Going to close this as resolved with the release of the latest beta version. If anyone would like it reopened, just get in touch