Skip to content
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

Opening a note that contains a YAML frontmatter changes it into a title #1582

Open
Julianoe opened this issue Sep 26, 2022 · 4 comments
Open

Comments

@Julianoe
Copy link

When a markdown note contains yaml style frontmatter as first lines, as soon as the note is opened, they are changed to a title.

More and more notes app that use local files use markdown and frontmatter for storing metadata. It's also the case of static sites generator that often use static markdown files. I wish we could think about a solution to avoid breaking frontmatter (if that's possible) to allow Nextcloud users to use Notes app as a way to edit those type of files

Steps to reproduce the behavior:

  1. Create a note in Nextcloud that contains any form of frontmatter for example this kind:
---
title: "🧑‍🍳 Recettes" 
modification: 2022-09-21 12:54:36 
tags: 
    - DIY 
    - cuisine
---
  1. Open Notes App and click on "edit" this note
  2. The frontmatter is interpreted as a title and saved as such:
---
## title: "🧑‍🍳 Recettes" modification: 2022-09-21 12:54:36 tags: - DIY - cuisine

Expected behavior
I get it that frontmatter can not be used because of the variety of standards, formats, and metafields used in differents apps or software... but please leave it alone!

Or maybe, then it would be a feature request, add the possibility to enable yaml frontmatter detection?

Smartphone:

  • Nextcloud Notes-Version (android app):
  • F-Droid or Play Store: FDroid
  • Android-Version: 7.0
  • Device: Blackview BV6000

Server

  • Nextcloud version: Nextcloud Hub II (23.0.2)
  • Nextcloud Notes version (server app): 4.3.1

thanks for reading

@daffydock
Copy link

daffydock commented Oct 18, 2022

Hi friend, welcome to the club.

See, this, and this and this , get acquainted. as they are all related.

I will leave it for someone else with yet more knowledge on the issues to go more into detail or you can check the above for background, but my understanding is that it is part of the underlying back-end software that Text is based on that renders the text. Which the Notes and thus, the Android app leverage.

Perhaps things have changed but last time this was touched on, the conversation pivoted to using .txt files over .md ones. Since the .md ones gets changed on open.

From one of the issues:

"The fundamental problem is that the new Text app is not really a markdown editor. It is a WYSIWYG document editor that happens to use MD syntax to store its documents. It does not respect the MD semantics in which files are text files, where every byte belongs to the user, and the MD syntax provides rendering advice and a readable structure to the unrendered text file itself."

@Julianoe
Copy link
Author

Julianoe commented Oct 18, 2022

Thanks for the welcoming explanation.
It seems there is quite a lot of threads about that indeed, both in this project, the Notes application project and in the Text application project nextcloud/text#593 is also related.
As I read it this comment seemed to summarize the problem quite well: « This is not following the principle of least surprise: An app that's first supposed to display things is not expected to silently modify files. »

After reading all those threads it seems that this app is just not aiming at us markdown-writing people. That's a shame because I feel that this app could easily do both.

I don't understand how this is related to the Text Nextcloud application though. The Notes android app does not work if Text application is disabled on instance?

@daffydock
Copy link

daffydock commented Oct 21, 2022

No worries, and you are welcome.

Indeed, I know this issue, as it affects me directly, too.
Essentially, you have this #331 from the Notes app, that lead to this, #779, and due to it, they share back-end resources and as such it seems they share both its negatives and positives. A positive being less work for the Devs to maintain, it seems. A negative being that it is reformats your notes when you work on them in Nextcloud. It is my understanding when reading previous issues that some Devs in the Nextcloud team saw this is as a feature, not a bug of the software the Text app is forked from, or at the very least, a limitation. Which from my readings was based off Tiptap, which itself was based of Prosemirror. When I looked into it a while ago, I found the Tiptap website linked on the Text app repository to be dead, however I found the new site which shows their New Beta release with lots of plugins. Take a look if curious here. Maybe they might get implemented with time, however, but I do not know that.

It seems that with limited resources, the focus is to serve the general public --who does not care about this type of formatting-- and not the smaller demographic, like coders and the like. As the central idea of the Text app is to be a colab tool.

The current suggestion floating around is to to use the previous text app that works with text files, instead. Someone opened a ticket about this here, if you are curious on that repository, #603. It does obfuscate workflow for people who care about formatting and as far as I know that is only on the Web UI. I am a little bit off the loop these days though as a decided to not use Nextcloud for this until a solution is reached.

I saw the updates on nextcloud/text/#593 so at least they are working on a possible solution. So that is good. Do not get me wrong, I like the Notes app on Android and use it extensively, just not for this use case.

Hope this helped. Cheers.

@max-nextcloud
Copy link

There seems to be a bit of confusion here. The notes app is not using the text app for editing.
As discussed in nextcloud/notes#331 text does not preserve the exact markdown syntax used and therefore using it in notes is not an option.

Notes (lack of) frontmatter support is therefore not related to texts way of approaching markdown editing. Text does support front matter these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants