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

Metadata in 2.0 #729

Closed
InnayTool opened this issue Jan 14, 2021 · 12 comments
Closed

Metadata in 2.0 #729

InnayTool opened this issue Jan 14, 2021 · 12 comments
Labels
type: discussion Something needs to be planned/discussed
Milestone

Comments

@InnayTool
Copy link
Member

In the current version of HedgeDoc metadata is specified by adding tags in a section on top of the document. This is done by using front matter in YAML syntax.

An alternative would be to specify the options and metadata by adding database fields and GUI elements.
This has several disadvantages:

  • More GUI which must be built
  • The API has to set set options as separate calls
    Advantages:
  • Backend doesn't have to parse these from the notes.
  • Markdown is cleaner -> fewer confusion of users who did not know about metadata tags.

We should decide which option we choose for 2.0.
Related issues:

@InnayTool InnayTool added the type: discussion Something needs to be planned/discussed label Jan 14, 2021
@InnayTool InnayTool added this to the Release 2.0 milestone Jan 14, 2021
@DerMolly
Copy link
Member

I think we don't really want to move much from the frontmatter. As it's easy to collaborate on and people are used to it not just with HedgeDoc, but with other Markdown software as well.

I think one could argue, that the breaks option could be put in the DB instead of frontmatter, if we wanted to change the default from true to false.

All old notes could be imported in the new schema with the breaks option set to true. All new notes would be false by default and anyone who wants to use breaks: true can do so.

Only question with that is:
What do more of our users expect? False or true?
I could be argued that should be the default. On the other hand, there is also a strong argument to doing what the "standard"1 tells us (aka breaks: false).

1 I know there is no real standard, but that's what most people do with markdown.

@ErikMichelson
Copy link
Member

Having the metadata inside the note content enables another good thing: Users can easily make backups of their notes including the metadata(!) only by downloading their notes.

@ErikMichelson
Copy link
Member

ErikMichelson commented Jan 16, 2021

We needed a legacy-field anyway in the database (for example for redirecting only old notes to /n/). This field could be used for checking whether the old breaks was used and thereby save us one additional breaks field in the database, or?

@mrdrogdrog
Copy link
Member

mrdrogdrog commented Jan 16, 2021

I'm against removing frontmatter. It's the industry standard for meta data in markdown and I think it would confuse more users than help them. But. We could:

  • (Warning! Just an idea!) Make front matter invisible in the editor if you don't want to see it. (don't know how easy that is)
  • Add a GUI Editor for front matter (which is already planned)

@InnayTool
Copy link
Member Author

I think it's no problem to add the metadata if clicking on download button and I think an additional field in the database is no problem.
In my opinion the relevant question to this, what do the most users think. Do they know of this industry standard? And are we want more tech users or others?

@mrdrogdrog why do you think it is not confusing if we make frontmatter invisible?
A GUI editor would make it more beginner friendly but don't remove parsing from development.

@mrdrogdrog
Copy link
Member

A GUI Editor will come in 2.0 anyway. But the plan is, that this Editor changes the frontmatter to cover beginners and advanced users.

I don't see any advantage in removing frontmatter than just breaking with a industrial standard.

Also we'll have to implement server side markdown parsing anyway, because if you don't define a title in the meta data, then the first heading is the document title.

@DerMolly
Copy link
Member

I think it's no problem to add the metadata if clicking on download button and I think an additional field in the database is no problem.

How should the metadata be added? As frontmatter? Then the backend needs to be more aware of the whole frontmatter than before…

@InnayTool
Copy link
Member Author

Do you mean because we have to add an function which inaserts it or because of importing notes with frontmatter?

@DerMolly
Copy link
Member

Do you mean because we have to add an function which inaserts it or because of importing notes with frontmatter?

Both, actually.

@InnayTool
Copy link
Member Author

Yes, maybe it's less about the work but more about separation of content and metadata and having no cached data in database.

@davidmehren
Copy link
Member

I think the discussion is mostly done here: We keep metadata in markdown/YAML and create a GUI to edit that.

The remaining question is how we handle legacy notes, but that should probably take place in a separate issue.

@DerMolly
Copy link
Member

The building of the Metadata GUI is tracked in #2884

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: discussion Something needs to be planned/discussed
Projects
None yet
Development

No branches or pull requests

5 participants