Customising NOAATable

96 views
Skip to first unread message

Auchtermuchty Weather

unread,
Feb 15, 2021, 9:45:17 AM2/15/21
to weewx-user
I much prefer the output of NOAATable for making the NOAA reports available.

However my template where I want this to appear is creating a Dokuwiki Page, so if the name in the link ends with '.txt' it looks for a file ending in '.txt.txt'.

I have it working with the drop-downs as per the header in the Standard website by not appending the '.txt' in the Javascript that loads the page.

What I'd like to do is customise NOAATable so the link is missing the '.txt' - I'd rather not write my own version of it if possible.

But I've searched & searched and can't find where & how it's implemented.  

Tom Keffer

unread,
Feb 15, 2021, 9:56:10 AM2/15/21
to weewx-user
I'm not sure what you're asking.

If you're asking how to customize the Javascript, it depends on the skin. For the "Standard" skin, it's in the template itself, index.html.tmpl. Just modify the template. For the "Seasons" skin, it's in seasons.js.

If you're asking how the name of the generated file is set, it's the template name minus the ".tmpl" at the end. So, if you don't want the ".txt" suffix, just rename the NOAA templates.

Does that answer your question?

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/79992f9a-7079-42bb-bb20-9df8fd088fbdn%40googlegroups.com.

Auchtermuchty Weather

unread,
Feb 15, 2021, 1:05:50 PM2/15/21
to weewx-user

The output files need to have '.txt' and the end, but the links to them mustn't include it so they fit the DokuWiki way of doing things.  By default they do and I can't find where that code is generated to amend it.

Tom Keffer

unread,
Feb 15, 2021, 2:08:48 PM2/15/21
to weewx-user
Did you check the locations I mentioned in my post? To repeat:

If you're asking how to customize the Javascript, it depends on the skin. For the "Standard" skin, it's in the template itself, index.html.tmpl. Just modify the template. For the "Seasons" skin, it's in seasons.js.

Auchtermuchty Weather

unread,
Feb 16, 2021, 3:12:45 AM2/16/21
to weewx-user
I'm using the Bootstrap skin which has $NOAATable which generates the layout I want. but not quite the code.  That's what I'm asking about - $NOAATable in the Bootstrap skin.

I wanted to find the $NOAATable source rather than start from scratch.  

Otherwise, I have custom Javascript in the Wiki, I have the drop-down way of displaying a NOAA-yyyy.txt etc. working in the DokuWiki page, my NOAA files are being correctly generated.


Tom Keffer

unread,
Feb 16, 2021, 8:27:54 AM2/16/21
to weewx-user
I see. Sorry, but I don't know anything about the Bootstrap skin. I assume it works in a similar way.

gjr80

unread,
Feb 16, 2021, 8:58:59 AM2/16/21
to weewx-user
If I understand your question correctly the $NOAATable tag is produced in the MyXSearch search list in user/historygenerator.py. The actual HTML for the links to the month and year NOAA format reports is produced in the _NoaaCell() and _NoaaYear() methods. I hope your python is good!

Gary

Auchtermuchty Weather

unread,
Feb 16, 2021, 10:37:07 AM2/16/21
to weewx-user
I see what you mean!  Suspect I had better rethink...  Thanks anyway.

Tom Keffer

unread,
Feb 16, 2021, 10:59:39 AM2/16/21
to weewx-user
Search list extensions which return HTML are nearly always a bad idea. The whole point of templates is to separate data from presentation. 

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Auchtermuchty Weather

unread,
Feb 23, 2021, 6:03:18 AM2/23/21
to weewx-user

Got around to looking at this, and it was easy thanks to your help.  Instead of 'return cellText' I used 'return cellText.replace(".txt", "")'

My Python is almost non-existent, but my moderate C# was handy.  :)


On Tuesday, 16 February 2021 at 13:58:59 UTC gjr80 wrote:
Reply all
Reply to author
Forward
0 new messages