‘HTML code’ notes in a Narrated Web report

I have started using notes of the type ‘Html code’. I want to use them to display simple tables in place of hard to format text. An example is:

Family name Given names Reg number Father's Given Name(s) Mother's Given Name(s) District

Which looks like this in a Narrated Web report:

There are two notes above, each with a little heading. The first is an Event Note and the other is an HTML code note.

The heading is the type of note displayed. The heading Event note is fine for the average reader, but the heading Html code is not meaningful to anyone.

I wonder if the type name for Html code notes could be suppressed when generating the report. Alternatively, I wonder if the words ‘Html code’ could be replaced by some other text at the time of generating. For example, this is a note about an event, so replace it with Event Note when generating the heading.

This name is the note type.
title = self._(note.type.xml_str())

You are speaking about gramps 5.1. In gramps 5.2 there are some changes:

Changing that is always possible. What can I put instead of html code as this note is html code ?
You can always see the 5.2 results:

Perhaps if the Note type is ‘Html code’ then just the word ‘Note’ would be displayed.

When I said it was not meaningful, I meant it was not meaningful to the average person viewing the family tree, who would not know what ‘Html code’ meant. All the other names of note types make sense to the average person, it’s just this one, which has a special purpose (the purpose is to alter the rendering of the note contents).

I am looking forward to 5.2.

The best way would be to create a bug report of type feature request.

1 Like

Thanks for the report.
PR #1176

Hmmm. You might also want to file a feature request for the NoteCleanupTool asking that it skip ‘HTML code’ notes. Otherwise, it could mangle features targeted for Narrated Web reports.

Good idea. I will do that.

1 Like

I pretty much have the same problem as originally stated and am curious about the version 5.2 even I did’n fully catch what are the changes. The layout in the example I like pretty much!

Based on just whats available in 5.1.3 I suggest to add the HTML as another option to the current option preformatted. Thus the type of the note remains for whatever reason it was intended originally inclduing user-defined types.

Furthermore with notes of type HTML code hyperlkinks where not highlighted in firefox - maybe its my fault, but in worked when viewing the identical code stand alone in firefox

In case you aren’t aware, there’s a “subject to changes” 5.2 Roadmap on the wiki. However, since it is manually curated, that document will always be a bit out-of-date and have ommissions.

You can prowl the GitHub project & MantisBT reports for items designated for 5.2 too. But it can be a pain to extract anything coherent out of that chaos. (I find the MantisBT filtering & search to be a pure misery. The Change Log is only a bit better. So I’ll download a CSV and find reports & status with Excel instead.)

What css do you use ?
In what page do yo get this ? (family? person? place? …)
Could you attach a link to see what happens?
Perhaps, the best way should be to attach the problematic page to a bug request!

I could reproduce the behaviour with a minimal setup, actually a person with a HTML Note including a link. Screenshot shows behaviour in generated website and same code “stand Alone”
Note looks like this:

This is a link to gramps-project.org/blog/

Please let me know in case I am doing wrong with the note, otherwise I will issue a bug report.
thx for responding to my sidenote

If this was an HTML type note. Then the note in Gramps would need to be a block of raw HTML code like:

<a href="https://gramps-project.org/blog/">This is a link to gramps-project.org/blog/2</a>

My understanding is that purpose of an HTML note is to be inserted in a webreport, without any interpretation. It isn’t to be browsable within Gramps.

Perhaps it should be called CODE instead of HTML Code? Any expectation of the program interpreting the code goes away with a generic name that doesn’t ID the interpreter.

That’s always a problem. For instance, even though I wrapped the above HTML code in <code> tags, I still had to use &amp;lt; instead of < to make the code not be interpreted. But then it would need an attribute IDing the interpreter so that Webreports had error management.

That’s probably just overthinking a problem that doesn’t exist.

Actually that the way text was entered in the note - when copying this HTML-code to the forum it obviosly was interpreted - sorry for the confusion. See a screenshot how the note looks like
HTML Code  bug

1 Like

There an extra (and unterminated) <body> tag there.

If you want the link buried under the descriptive text, you can use the Links Editor. It works for more than external links, you can create internal Gramps links to other objects which the Narrated Web will use.

Type in the descriptive text, select it then open the Links editor.


Be aware that the link editor has an ugly idiosyncracy. (At least in Windows. I don’t know it also applies to Linux or macOS.) It purges whatever is in your paste buffer & replaces it with the Note text you highlight.

And since the Link Editor is modal, you can’t select anything in the Note. (So while you might try to temporarily stage what is in your paste buffer in the Note, you can’t get to it while the Link Editor is up. Nor can you use the clipboard or drag’n’drop from other views.) That means using an external Notepad program for staging.

I try to avoid the Link Editor because of these aggravating quirks. Plus the internal links mess up Gramps in other ways. If you link that 16th-cousin famous person who was noted as attending the funeral in the obit, then some Gramps features promote that Seven-Degrees-of-Kevin-Bacon connection over the blood Relationship.

Sorry again, however behaviour does not change after correction respectively creating the link newly. See narrated web behaviour, stand alone htlml code both in firefox and code of the HTML-Code Note

I do not believe that the HTML Code should be an entire HTML document with headers… just a well-formed chunk. No open tags, no document framework tags (like <body>).

The exceptions are the Home Page, Introduction Page & inserted Extra Pages. I do not know if those are HTML fragments inserted into a homogenized header/footer shell or expected to be full stand-alone documents. Logically, I would expect full pages to be media objects rather than Notes.

(@SNoiraud is there a way to insert a fully separate webpage for an individual & have the Narrated Web Site Report link to it? )

The HTML Note is for when you want to do something like: have the Narrated Website Report insert a table with in-line CSS.

Give it another shot and let us know.

Behaviour is the same when using just the minimal chunk (which actually was where I started from).
Since it was mentioned that 5.2 has mayor changes to HMTL notes we should forget about this and I will check behaviour once the new version is availbale (hopefully soon).

Thanks anyway

1 Like

You can only insert tags contained in the html body in a note.
The following tags will always be ignored:
html, meta, doctype, head, meta, title, link, script, body

all other tags will be available :
i, a, p, ol, ul, div, h1-h7, button, svg, table, tr, td, …

1 Like