Remove superfluous note names

It’s not an opinion. It’s the only way in plain HTML/markdown to have something that is both semantic and displayed.

Even Joplin's own markdown export adds the name as unmarked plaintext at the top of the document. There is no way to have it in a plain (non-meta-sectioned) markdown document besides #.

https://www.w3schools.com/tags/tag_hn.asp:

Note: Only use one <h1> per page - this should represent the main heading/subject for the whole page. Also, do not skip heading levels - start with <h1> , then use <h2> , and so on.

w3c itself gives examples, e.g., https://www.w3.org/TR/WCAG20-TECHS/G141.html:

A page on cooking techniques uses a h1 element for the overall title, and h2 elements for major sections on cooking with oil vs cooking with butter, and h3 elements for sub-sections on oil-cooking techniques.

https://www.w3.org/QA/Tips/Use_h1_for_Title:

  • If the document is basically stand-alone, for example Things to See and Do in Geneva, the top-level heading is probably the same as the title.
  • If it is part of a collection, for example a section on Dogs in a collection of pages about pets, then the top level heading should assume a certain amount of context; just write <h1>Dogs</h1> while the title should work in any context: Dogs - Your Guide to Pets.
1 Like

This is also a matter of opinion. If you define the first line of the note body as the title, then you don't have an extra field.

Once again - and I am sorry, but you won't convince me otherwise. A document structure that looks like the following is wrong:

1     Title
1.1   Section 1
1.1.1 Section 1.1
1.2   Section 2
1 Like

If you define the first line of the note body as the title, then you don’t have an extra field.

That's what I've been asking for. But the first line is typically a H1/#-level heading.

A document structure that looks like the following is wrong:

That's about numbering. HTML/markdown don't include a numbering scheme.

I think the whole h1/…/h6 scheme is a disaster, and h1 would indeed be more meaningful as a first level sectioning tag with different markup/tag for the in-body title, but that's not how it is. There is no specific visual-semantic title tag in HTML or markdown, only the metadata title tag that does not typically get rendered. So h1 is what has to be used for the visual title, and W3C tells to do so. That is what we have to live with (sticking to HTML and standard markdown).

1 Like

Perhaps one reasoning for the h1/…/h6 scheme in HTML is that in HTML/markdown documents are typically part of larger sites (or Joplin notebooks), where each page/note is a section. Then the “one“ in h1 makes sense despite having to use it for what is in effect a title for a page (which itself is a section of the site).

I don't get what's the fuss about - just fork the source from Github, modify it to your heart's content(it's fun, trust me) and then use it.
If you really have got the hang of it then publish it as Joplin NI. :wink:

Please do NOT implement this suggestion as this is dreadful idea. I do not want the first line of the note to be the name of the note. I want to be able to name my notes based on the overall subject matter or content, not on the first line. This is like removing the subject field from an email.

6 Likes

I’m reconsidering, but just to understand, if you print a note, do you print the title ?

As far as I understood, there seems to be two ways people prefer to write their notes - the heading as a part of their note or as something distinct from the note. If the title bar is removed, the people of the second camp will be in trouble. Putting an option to toggle it might be a good idea but may not be so simple from a layout POV and perhaps has some more technical limitations too.
As for the printing issue, can it not be fixed with CSS in the stylesheet?

1 Like

Yes, the title is currently added to the printout/PDF. But this is something that we can fix by either using a class for that element so that you can remove it with CSS or an option in settings. (But I think that Laurent tries to minimize the number of settings.)

I can do either way, depending on Laurent’s approval.

6 Likes

I use Joplin to store legal documents i.e. court transcripts. They need to be an exact copy of what has been published; they should not be amended. The document does NOT necessarily contain (at the top or elsewhere) a suitable title. Your suggestion means that I have to add an additional line to the top of the document, which alters the original so that I can have a meaningful title. That is nonsensical.

3 Likes

This is definitely your opinion

If you can add a class that would indeed be a good start, and an easy way to allow customising the pdf or printout.

Yep, I was looking for the code I wrote a while back to fix the title/toc problem, but it’s no longer there. Refactoring removed the file and added a new service and I am currently trying to find where the title is added to the printout. Hmm, the code base is getting bigger…

Right, it got moved InteropService_Exporter_Html when I refactored to support HTML export, and so that PDF and print can all be based on the HTML export service.

And actually I see the title already has a class “exported-note-title” so it should be possible to hide it or customise it already.

1 Like

Is there a full list of css classes somewhere? I have modified my layout in userstyle.css but I have always based it on hints I have got from here. If I could find a full list then I could customise my theme more confidently.

Cheers.

1 Like

There isn’t a full list anywhere, but if you toggle development tools you can use the debug selector to click on any element and be given all the info about it (html element name, CSS class, etc.). Additionally you can change the CSS properties using the debug tools to preview how things will look. This is the best method for tweaking CSS with Joplin IMO.

The selector tool is in the very top left corner of the debug window and it looks like a mouse pointer clicking on a square.

Edit: more info

For Jekyll and similar markdown-to-static-webpage tools, the de facto standard is to have the page title set using YAML-compatible metadata. This is also the place for other document metadata, such as a published date and document tags. For example:

---
title: The Ministry of Silly Walks
date: 1970-09-15
tags:
  - Mr. Putey
  - Mr. Teabag
  - cult classics
  - John Cleese
---

# Scene One

A man walks very peculiarly to his workplace, The Ministry of Silly Walks.

# Scene Two

The man rejects a new silly walk proposed to him.

Actual rendering of this depends on page layouts, but as most preexisting guidelines for HTML strongly encourage only a single H1 per page, it will usually involve rendering the title as an H1 and headings starting at # as H2 and down.

1 Like

I would love if this data was additionally stored in the markdown as yaml.

I personally like the simplicity of the app showing things like a “title” input box, but would love if the date, tags, title, alarms, etc were all available on export and when editing in an external editor. That seems like that would give a lot of power and longevity to the system! Could even be a setting, where you can either show or hide the yaml in the markdown file.

Just for reference…

Here’s the required css (in userstyle.css) to not print the document title (or when creating a PDF):

@media print {

	.exported-note-title {
		display: none !important;
	}

}
1 Like