-
Notifications
You must be signed in to change notification settings - Fork 1
Markdown in Drummer? #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not sure what "Markdown outline" features you are looking for Drummer, Dave. However, I know Logseq have export/import OPML features that could be used as benchmarks/samples. Logseq Markdown outline flavour is quite unique to it, while being valid standard GFM Markdown. AFAIK, Obsidian doesn't natively support outline, instead relies on an outline plugin for that Markdown outline feature. Key issue is Markdown have two main hierarchical constructs that can be used as outline hierarchy. The "#" headings and "-" unordered list items hierarchy. Originally Logseq used "#" exclusively for outline hierarchy. Now it use "-" as main outline hierarchy with some allowance to use "#" as top level outline headings (summit headlines). I hope that's of some use. :-) |
@sabre23t -- yes that is helpful. i'd like to be able to import LogSeq outlines in Markdown format and also export them. It would be helpful to have a few example files. Actual files exported from LogSeq. Could you paste the text from them into comments here? |
Lets start with roundtripping your OPML spec example states.opml. Logseq v0.4.4 import that states.opml into states.opml.md with text contents as below. title:: states.opml
- United States
- Far West
- Alaska
- California
- Hawaii
- Nevada
- Oregon
- Washington
- Great Plains
- Kansas
- Nebraska
- North Dakota
- Oklahoma
- South Dakota
- Mid-Atlantic
- Delaware
- Maryland
- New Jersey
- New York
- Pennsylvania
id:: 614800f3-e336-45e5-849e-fe64ea361d35
- Midwest
- Illinois
- Indiana
- Iowa
- Kentucky
- Michigan
- Minnesota
- Missouri
- Ohio
- West Virginia
- Wisconsin
- Mountains
- Colorado
- Idaho
- Montana
- Utah
- Wyoming
- New England
- Connecticut
- Maine
- Massachusetts
- New Hampshire
- Rhode Island
- Vermont
- South
- Alabama
- Arkansas
- Florida
- Georgia
- Louisiana
- Mississippi
- North Carolina
- South Carolina
- Tennessee
- Virginia
- Southwest
- Arizona
- New Mexico
- Texas
- United States
- Far West
- Alaska
- California
- Hawaii
- Nevada
- Reno
- Las Vegas
- Ely
- Gerlach
- Oregon
- Washington
- Great Plains
- Kansas
- Nebraska
- North Dakota
- Oklahoma
- South Dakota
- Mid-Atlantic
- Delaware
- Maryland
- New Jersey
- New York
- Pennsylvania
- Midwest
- Illinois
- Indiana
- Iowa
- Kentucky
- Michigan
- Minnesota
- Missouri
- Ohio
- West Virginia
- Wisconsin
- Mountains
- Colorado
- Idaho
- Montana
- Utah
- Wyoming
- New England
- Connecticut
- Maine
- Massachusetts
- New Hampshire
- Rhode Island
- Vermont
- South
- Alabama
- Arkansas
- Florida
- Georgia
- Louisiana
- Mississippi
- North Carolina
- South Carolina
- Tennessee
- Virginia
- Southwest
- Arizona
- New Mexico
- Texas
- That "id:: 614800f3-e336-45e5-849e-fe64ea361d35" is an artifact of my Logseq graph (database) having a block reference to an item called "Pennsylvania". In general you see block level (headlines level) attributes are dropped. And only "title::" page level (head level) attribute was maintained. Lets now round trip it back into OPML by exporting from states.opml.md page in Logseq v0.4.4 into OPML. The text contents as below:
Logseq forgets to export the "titlle::" attribute. There's also the erroneous additional blank headlines at the start and end of the outline. Is that still useful? Is there more complex OPML that you'd like to see being round tripped? Is there a better way to show MD/OPML code blocks in Github comments? |
I'm starting to experiment with code that supports this format. A couple of questions.
I hope to have something for you to look at soon. ;-) |
Another question -- The states outline only has one summit. Can these outlines have more than one summit? Drummer outlines can have multiple summits. |
Okay -- here's the first result. https://github.com/scripting/tmp1/blob/main/demo1.md That's states.opml as exported by Drummer using the format supported by various tools for thought apps (TFSBVTFTA). The format needs a catchier name. 😀 |
Dave wrote:
I see that http://hosting.opml.org/dave/spec/states.opml have one summit. The earlier import/export test shows two summits. Logseq does support one or more summits. I ran the OPML import test again on Logseq v0.4.5 with current content of states.opml (one summit).
It displays correctly in Logseq as one summit but didn't import all attributes. It saves that Logseq page as states.opml.md .
I then export that into OPML again.
|
Dave wrote:
Yes. Logseq MD file states.opml.md use tab (\t) for each level indentation.
Yes. Logseq MD file states.opml.md use Unix LF (\n) for end of line. Logseq will accept MD file with Windows CRLF (\r\n) for end of line, but on edit will resave as Unix LF format. |
Dave wrote:
Noted this is MD file using tab and Unix LF format. Logseq has no import command for MD files. You just copy the MD file into Logseq pages folder and do a "Refresh (import changes from local files)". Doing that gets me this screenshot in Logseq. I also note:
Upon edit and resave by Logseq the MD was changed a bit.
|
@sabre23t -- more than a month later ;-) I'm working on making Electric Drummer work with LogSeq markdown files, and in doing so hope to gain interop with Obsidian and perhaps other products. The way it works is that when E/D opens a file, I look at the extension. If it's .opml, i proceed as usual. But if the extension is .md -- first I convert it to OPML and pass it on up. At that point Drummer doesn't know it came from a markdown file. It works. Below is a screen shot of an outline i created in Logseq and opened in E/D. When saving it will reverse the process if the file has a .md extension. Not sure how much fidelity will be lost. Just beginning down the path, haven't implemented attributes yet, this is just Day 1 of this adventure. 😄 |
That's great @scripting 😄 |
Here's a demo of two-way interop. I've read in an outline from LogSeq. Edited it. It autosaves, the change is immediately reflected in LS. |
How to create attributes in LogSeq? Suppose I want to add an attribute to Oregon that says what its average temperature is. What is the UI for that within LogSeq? |
OK -- I think I figured out how this should work.
With this you can use Drummer to add atts to a LogSeq outline. I no longer need to know how to create an attribute in LS. What this will be useful for is using Drummer to edit a LS outline. It might also be possible to incorporate a LS outline in a Drummer project, I have to learn more about editing in LS to figure out how that might work., |
A podcast about this project... http://scripting.com/2022/01/01/thoughtsOnInteropInOutlineLandBasedOnMarkdown.m4a |
An attribute/propery in logseq is just part of the node/block. It's the first few lines of a block [1], no specific UI [2]. It's any name ending with "::" followed by one or more values. Ref https://docs.logseq.com/#/page/term%2Fproperties . You can hide any of your properties that you don't want to see in Logseq display mode. You'll only see those properties when you edit the block. Set it by editing
Edit: |
When I saved my drummer outline with all its attributes the were all shown visibly in logseq. I gather from what you’re saying is I can set a pref to disable this. |
Yes. Logseq ellipsis Visible block properties is useful for properties like reference number, phone number etc. Logseq does not store all its block related properties in the MD file. It stores only permanent properties/information in the MD file. If you enable "Developer mode" in
|
I’m just trying to make drummer interop with it. Is any meaningful interop possible by reading and writing the .md file? I’m not asking anyone wanting to interop with drummer to understand it’s internal workings. |
Reading and writing the MD files from Drummer could surely allow meaningful interop. Providing both reading/writing operations on MD files from Drummer side does allow both way transfers/interop with other system using MD files. Conversely, Logseq also provides both way operations on OPML that could be basis for interop. You can export page/graph to OPML. You can also import OPML files. Unfortunately as of now Logseq OPML transformation is very lossy. Many attributes are lost, even title becomes "untitled". Doing the Logseq/Drummer interop on Drummer side via MD, with better and more complete transformation of features in OPML to/from MD would surely show the way forward. To do so I think the following key features should be prioritised:
Anyway, that's just my2cents. Look forward to test such markdown two-way interop when you release the feature to us Drummer users. 😄 |
Okay I suggest we proceed as follows:
Does that make sense? |
Yes, that does make sense. My main machines are Windows based. If you could put some of the functionality to test into Web Drummer, even if it's just in the DW menu, I would appreciate it. 😄 I understand Electric Drummer is Mac only at the moment. If I really needed to use a Mac, I think I could borrow some time on my daughter's Macbook Air. But I'm totally a newbie on macOS. Currently I'm a daily user of Drummer for public blogging. And daily user of Logseq for private journaling & knowledge base. Look forward to test the interops between them. |
@sabre23t -- that's why I asked. Something you posted earlier implied you didn't use E/D, that's why I wanted to check. I'll look into how much work it would be to support it in web Drummer too. |
I've created a small project that takes a sample LogSeq markdown file and converts it to JSON, OPML, and a new markdown file and compares it with the original. https://github.com/andrewshell/test-opml-md
|
@andrewshell -- thanks for posting these notes here. @sabre23t -- likely will see them overnight, he's in Malaysia I believe. On the other side of the world. Andrew has been reviewing the new OPML package as it's been coming together, and now it's time to connect that to Drummer, as you'll see in the next comment. |
I just made the changes to web Drummer so that it can now read and write .md files in addition to .opml files. It's version 2.0.15. What this means --
In theory you should be able to make the files public, and then you can probably figure out how to get LogSeq to read it. I am finished for the day, unless there's an emergency (like I broke something in these changes, it's been known to happen). |
I was able to make my outline public. http://drummer.scripting.com/cluelessnewbie/states.md I'm now going to try to fill it with the example outline from the OPML package. |
Here's the blog post. http://scripting.com/2022/01/08/153904.html?title=whyLogseq In conclusion -- we are not supporting head-level attributes in the Markdown format at this time. Too much confusion. I want to try to find meaningful interop with the support we have now. I think we will find there is quite a bit. |
OK, here's a question for the LogSeq users here. I understand how the daily journal feature works. If I quit and relaunch LS it opens up a new page for today. There's a folder in my LS folder called Journals. All those files end up there. I can easily set it up so the contents of a Drummer calendar is mapped to their journal structure. Finally -- here's the question. What features hang off the journal structure in LS? I can tell you what hangs off it in Drummer -- the blogging system. Also Daytona. Haha this would be very useful I think. With this you could use LS to author a Drummer blog. What about in the other direct, what good things will LogSeq do with the journals? I assume they are in a graph of some kind. Another thing is I could use Drummer as my LogSeq editor, which is something my mind would like. Drummer's outliner works much better for me. |
Dave wrote:
As I understand it, Logseq journal per day page/file structure serves quite similar purpose to what calendarDay & calendarMonth node types do in Drummer blog.opml. It groups and dates all the nodes within it. Drummer use it for publishing to OldSchool. Logseq mainly use journal pages as dates for its todo tasks management. Any nodes in journal pages are potential tasks that are made so by prefixing with markers: TODO, NOW, DOING, DONE, LATER etc. Logseq default journal template queries/display NOW/DOING tasks for previous 14days, on current day view. This is alternative to GFM tasklist markers: [ ] & [x].
Yes, I would certainly love to be able to do this. I'd setup a second Logseq repo with all public info (daily blogs and named pages) that I'd want published in a Drummer blog. I'm currently doing copy & paste sub-outlines from my private Web Logseq repo to my public Web Drummer blog . Unfortunately this does not fully copy in attributes (bold, italic, external links etc), or the sub-outline structure. I tried to copy this Logseq sub-outline: I used Logseq's 3 "Copy as" options OPML/TextMD/HTML to copy & paste in a Drummer blog post: OPML - May be Logseq didn't set some clipboard settings so Drummer didn't understand the paste as OPML (instead of text). Also Logseq didn't translate MD into HTML for inline italic, bold and link tags. I would love to see at least this use case be better. |
@scripting Hello! It's been a while. I've been using LogSeq a bit lately because I wanted a good Linux desktop outliner. That's been one of my holy grails for a long time now.
The big thing that I use the journal for is to "narrate my work" for the day. I write down a list of things to do. Some headings becomes TODO check boxes. Other headings become notes. There's no obvious way to share my work journal with my colleagues, like people used to do with UserLand Frontier. But I can rearrange and update it as I go, keeping a record of my mental context. Then the next day, I review yesterday and starting writing down a plan for today. I use it as a personal productivity tool, instead of as a blog. I have two plugins installed to help with the journal:
The journal is a pretty nice feature. It's so simple. Basically, LogSeq treats "narrate your work" as the center of the product, and everything grows around it. It's an interesting bet. I understand that if I create a second LogSeq folder, I can have a second journal. So blogging might be another possibility.
I've seen those YAML front matter attributes before. There are a whole bunch of static blogging packages, mostly derived from or inspired by Jekyll. They tend to use front matter like this: ---
title: "My Blog Post"
description: META tag stuff for Google
tags: outlining,drummer
date: ...
published: false
---
Post body is Markdown. I think GitHub even detects this front-matter and renders it as a table. I don't have a concrete interop use case for front matter right now, but I wouldn't be surprised to run into one, either. I guess the biggest challenge is that everyone uses front matter for something, but it tends to be application specific. Oh, and one final thought after using LogSeq a bit: It's amazing how often I want to import data into the system, or export it out to something else. A lot of my LogSeq outlines will eventually turn into regular Markdown files that get committed to a shared git repository. Or they get converted to a post on Slack. Markdown is everywhere these days. This kind of interop is a major selling feature, and one of the things that your outlining tools were always great at, thanks to the built-in scripting. |
@emk -- wow so good to hear from you, especially in this context. there are so many ways we can add value to what you're doing in LogSeq, esp in re GitHub. i have a new "product" almost ready to go, something i've been using in Frontier for a number of years, that allows me to edit a project in an outline and distribute subs to various different places on github, s3, the local file system. it's how i have been doing all my dev work since 2013 or so, and it runs in Drummer. it also does markdown really well, and javascript, and of course outlines. i know about yaml. i did a project based on a wizzy github editor i did a few years back. so i have working yaml code in my toolkit. but who needs another format for this! oy. will we never just build on what we already have. anyway this is going to be fun. 😄 |
@sabre23t -- i think we found our first project. mapping a LogSeq journal to a Drummer blog. Yes? I think you said you'd love to get that working. Me too. I think that's a great first project. here's a question on how we'll do it -- how can we access your logseq files via web drummer without you having to import them one at a time. we want something that automatically updates. if you were using electric drummer it would be easy. can you mirror a logseq journal anywhere that's publicly accessible on the web?? btw we got really lucky that @emk is in the loop (see above). we've worked together very effectively many times. |
@emk -- here's a complete list of the verb set in Drummer, to give you a rough idea of what it connects to now. https://github.com/scripting/docServer/blob/main/docs/readme.md |
@sabre23t and others -- here's my plan for the first rev of the LogSeq Journal ==> Drummer blog connection.
|
There's a menu item in LogSeq that said Make it public for publishing, but all it did was set a flag marked I also turned on Settings > Developer Mode, which gave me an experimental **Plugins..." menu item. And I looked through the plugin marketplace. There are plugins to export to Todoist and to some habit tracking tool. There are also plugins to import outlines from various places. The plugins look like simple JavaScript, so there's probably some long-term potential here for LogSeq users to build useful interop tools.
That doesn't surprise me at all! Out of curiosity, is Electric Drummer an Electron app? And if it is, how hard do you think it might be to get Electric Drummer working on Linux? It's the ultimate niche market, obviously, and I can't imagine it's commercially worth it. But I thought I'd ask, because sometimes an Electron app is easy to turn into a Linux alpha release. Fully polished Linux releases, sadly, are often more work. Many years ago, I looked at what it would take to get the GPLed Frontier running well on Linux, and it looked pretty overwhelming.
This is such a good idea. "Mirror heading to S3" or "Mirror heading to pretty Markdown file" or "Mirror heading to repo" are obviously lovely features. Sometimes it's even feasible to support two-way sync, but that's obviously harder if you don't want to lose too much metadata when converting back and forth. Once I have a nice outliner, there's such a temptation to use it for editing all different sorts of things. I saw a great plugin for org-mode that had two-way sync with the Trello task management tool. Here's a video with poor sound quality and a fairly clunky text UI, but it's neat to watch the outline stay in sync with the shared Trello board. There's a lot of potential for good, user-friendly outliners with lots of integrations and plugins. But I don't have to tell you that. :-) |
@emk -- quick response, more later -- yes electric drummer is electron. and the plan is to go to linux, i want to move my act there. apple is not a good place for what i do, and i'm quite comfortable with linux these days, all my servers are linux. so yes -- it's very high on my list. but my list is long. ;-) |
Oh, I understand completely. There are always a million things to do. But if you do get around it, feel free to ping me if you need some Linux Electron help. At the very least I could alpha test and debug annoying packaging issues. Integrating with LogSeqAlso, in the interest of figuring how to export data from LogSeq (or pull it back in), I dug through their hidden, experimental plugin marketplace and found some neat things. The most promising example is this: (all images from the linked pages) As you can see from the screen recordings, there's apparently a lot you can do using "/" commands. I could easily imagine a I still can't figure out a good way to mark a heading to automatically export, though. The other really neat thing I discovered were "renderers". These take a heading containing
The neat thing about these is that they keep in sync as you edit the subheadings. So I could also imagine "creatively applying" this mechanism to keep an export in sync, using something like:
Probably you'd have to figure out how to specify the blog ID somehow. This stuff is clearly completely experimental, still. There's a third type of plugin which adds an icon to the title bar. Here's an example: This kind of plugin seems to be best for "full page" operations, or for things which affect an entire LogSeq directory. Anyway, this is just a super quick summary of possible integration points. I won't have time to build any plugins this month, but maybe another LogSeq user will get some ideas about how to send data to Drummer. With just a little help from the LogSeq end, it would probably be super easy to flow data out into Drummer and do cool things with it. (EDIT: Of course, it works fine to pull data, too, especially from something like the journal. I'm just looking at the various options, trying to find interesting possibilities.) |
@emk -- I don't think it needs to automatically export. This is my current plan for how this will work. Also it couldn't hurt to try creating a Drummer blog in Drummer to see what the goal is. The docs, I am told, are quite good! :-) |
Unfortunately, my laptop is starting to have cooling fan problem, so writing this from my note mobile. Emk wrote:
I think current Drummer / Logseq interop is going towards the same model as Obsidian / Logseq interop. There Obsidian / Logseq edit the same folder of MD files. Major benefit is all integration can be done from Drummer end and its outline scripting environment. Dave asked:
Perhaps you can update Web Drummer to be able to open a local folder. The same local folder that Web Logseq stores mylogseq repo (with journals & pages subfolders). There's some permission issue in current Chrome browser that requires granting access everytime I refresh Web Logseq though. I'm using Web Logseq from my laptop.
FWIW, the plan looks good to me too. |
@sabre23t -- I noticed that LogSeq is using a browser API I am not familiar with. We have everything we need on the Drummer side to be able to do this, once we have a way to access the files in the Journal folder. It'll all be very fast imho. I think this is the API. 😀 However I think it says it's only accessible from HTTPS pages. Oy. That's too big a hoop to jump through for a quick feature addition. PS: Maybe the fastest way to get to nirvana is to do the Windows and Linux versions of Electric Drummer. I don't have a desktop Linux machine here, just servers -- and I don't have a Windows machine either. |
I think reading the journal from disk is excellent plan, for whatever my opinion is worth. :-) I've played around with Drummer a little bit, and it's fun to see many "old but good" ideas be reborn on the web. I may try out a blog at some point! Just out of curiosity—and I know this is a huge digression from the real work you folks are all doing in this thread—is there a way to create an outline in Drummer using POST? Does web Drummer use any server-side storage at all, or is it all local? (You can see that I'm still pretty clueless here.)
As a long-time desktop Linux user for most of the last quarter century (yikes!), here's a rambling digression about my experiences. When I was in college, it was great fun to install desktop Linux and fight with it until it worked. I learned a lot of Unix! But now I'm a couple decades older and I don't want to fight with desktop Linux any more. I want decent hardware, with Linux pre-installed and fully supported. And if it breaks, I want someone to come and fix it. For my last few machines, I've had good luck with Dell's Unbuntu laptops for business. These come pre-installed, and I just unbox them, create an account, and start working. Right now, I'm running a fully loaded Precision 5560 (or maybe a 5540). It's not as rugged as a Mac, but I make sure I always have the next day on-site support plan. I had a screen failure this past summer, and they actually sent a tech to drive out into the middle of nowhere to replace the screen. The "next business day" promise turned out to be an exaggeration in the countryside in the middle of the pandemic, but they did fix it. There might be a better option somewhere, but this is the best I've personally found in 25 years of desktop Linux. Anyway, on to Electron stuff. For me, the hardest part about porting an Electron app to Linux was building and packaging it. The actual code didn't require many changes at all. And once I had it set up, it was pretty much entirely automatic. |
@emk all storage in web drummer is on the server, that I run. |
Great! Out of curiosity, is there any way to POST an outline to Drummer? I had at look at the docs and doc server, and there are some really useful integration tools there. |
@emk — yes. Where are you posting from, inside drummer or outside? |
Outside Drummer, if that's possible! |
@sabre23t & @emk -- a thought about how to get the LogSeq journal files into the cloud from the desktop. It's an Electron app. Of course now it only runs on Mac. Not sure how hard it would be to port to other platforms. It depends on a Node module called chokidar which claims to be cross-platform. ;-) |
Update -- I tried Window.showOpenFilePicker to get started on accessing the local file system. I did it from within an HTTPS page. It says the function is not defined. Running in a fully updated version of Chrome. |
Actually, mylogseq repo is already in the cloud (Dropbox). I use Dropbox on Android to download/upload Logseq Android local files. Would that be as workable as publicfolder.io for interop with web drummer? |
@sabre23t — maybe. Dropbox has an api. It would be easier the files were on the web, or GitHub. I think logseq used to have a way to mirror to GitHub. Is that something you could look into? |
LogSeq 0.5.4 has an option to automatically commit to a git repository every minute as you edit. I don't see any way to push this repository automatically to GitHub. But users could push it manually using any git client, or I'm sure there's a tool that auto-pushes. For S3, try |
Dave wrote:
Yes. I have TortoiseGit (windows shell) and Git Bash that can mirror/sync a local folder to a Github repo. I've used them for some collaborative mapping apps. Regarding "mirror to Github", what Logseq deprecated is Web Logseq backend link to Github. However, Logseq continues supporting local folder synchronization with third party cloud services including Github. This works well except for "pages-metadata.edn" file that stores created-at and updated-at date/time for all Logseq files. |
I have code that turns a Journals folder into an Old-School-ready OPML file. Here's the writeup. http://scripting.com/2022/01/11/215549.html?title=whatIDidToday Tomorrow I'm going get it working with Old School. Knock wood. |
I have a Drummer blog building from my LogSeq journal. http://oldschool.scripting.com/mylogseqblog/ You do not need Electric Drummer to do this. It's a simple Node app. You provide the configuration in a config.json file in the same folder as the app. I'm going to do some cleanup and then publish the app, in source of course. |
It's ready for testers. Please report success or problems in that thread. |
Just posted a change note about Markdown in Drummer. This is a place to discuss.
The text was updated successfully, but these errors were encountered: