otherjoel / thenotepad

📓🍎An experimental blog written in Pollen / Racket
https://thenotepad.org
Other
78 stars 9 forks source link

Make errors #6

Closed jbshirk closed 6 years ago

jbshirk commented 6 years ago

Hi, I am starting to get my hands dirty with thenotepad.

Following the instructions, I get a compiled site, but I wondered whether I should be concerned about a bunch of errors and warnings I got during my first make, such as:

Config: unknown option: drop-empty-elements
Error: Can't open "no"

line 33 column 9 - Error: <header> is not recognized!
line 33 column 9 - Warning: discarding unexpected <header>
line 35 column 13 - Error: <nav> is not recognized!
line 35 column 13 - Warning: discarding unexpected <nav>
line 42 column 13 - Warning: discarding unexpected </nav>
line 43 column 9 - Warning: discarding unexpected </header>
line 45 column 9 - Error: <article> is not recognized!
line 45 column 9 - Warning: discarding unexpected <article>
line 46 column 13 - Error: <header> is not recognized!
line 46 column 13 - Warning: discarding unexpected <header>
line 46 column 225 - Error: <time> is not recognized!

All of the pages generated similar errors; you can see them here, if you want: https://gateway.ipfs.io/ipns/QmZJBQBXX98AuTcoR1HBGdbe5Gph74ZBWSgNemBcqPNv1W/internetapocalypse/Installation+first-make.md (jump to: "###First make")

otherjoel commented 6 years ago

This looks to me like you have an outdated version of tidy which doesn’t recognize HTML5 tags or the drop-empty-elements command-line option. Check which version you are using by running tidy --version — on my machine it outputs HTML Tidy for Apple macOS version 5.6.0

You can get the latest version at the HTML Tidy website.

I only use tidy in the makefile so that the HTML source is pleasant to look at, and it’s slightly easier to debug that way too when doing View Source in your browser. But it’s by no means a necessary step. You could eliminate all calls to it from the makefile and still get perfectly useable HTML output.

Even with the latest version, Tidy has a few errors on some pages of the site which I have chosen to ignore for now. (Unencoded ampersands in link URLs, that sort of thing)

jbshirk commented 6 years ago

Ah thank you! Good to know! Here's the version I had by default:

HTML Tidy for Mac OS X released on 31 October 2006 - Apple Inc. build 15.18.1

After updating tidy to the most recent version, those errors above are gone, but now this, concerning only two pages (unmodified from the default installation):

string-split: contract violation
  expected: string?
  given: #f
  context...:
   /Applications/Racket/collects/racket/string.rkt:113:0: internal-split
   /Users/joe/Sites/racket/frog/exospheric/internetapocalypse/util-date.rkt:9:0: datestring->date
   /Users/joe/Sites/racket/frog/exospheric/internetapocalypse/util-template.rkt:24:0: post-header
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/render.rkt:212:0: render-markup-or-markdown-source25
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/render.rkt:135:0: render20
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/private/cache-utils.rkt:99:2: fetch-dest-file
   /Applications/Racket/collects/file/cache.rkt:63:2: fetch-and-continue
   /Applications/Racket/collects/racket/contract/private/arrow-val-first.rkt:428:3
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/private/cache-utils.rkt:90:0: cache-ref!12
   /Applications/Racket/collects/racket/private/more-scheme.rkt:376:2: hash-ref!
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/render.rkt:71:0: render-from-source-or-output-path
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/render.rkt:52:0: render-batch
   ...higher-order.rkt:357:33
   (submod "/Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/private/command.rkt" raco): [running body]
   for-loop
   run-module-instance!125
   ...
Document: "books.html" is not a file!

There is one other, similar:

raco pollen render about.html; \
    tidy -quiet -modify -indent --wrap 0 --tidy-mark no --drop-empty-elements no about.html || true
rendering about.html
rendering: /about.html.pm as /about.html
rendering: /template.html (from cache)
"CREATE TABLE IF NOT EXISTS `posts` (`pagenode`, `published`, `updated`, `title`, `header_html`, `html`, PRIMARY KEY (`pagenode`));"
"CREATE TABLE IF NOT EXISTS `posts-topics` (`pagenode`, `topic`, PRIMARY KEY (`pagenode`, `topic`));"
string-split: contract violation
  expected: string?
  given: #f
  context...:
   /Applications/Racket/collects/racket/string.rkt:113:0: internal-split
   /Users/joe/Sites/racket/frog/exospheric/internetapocalypse/util-date.rkt:9:0: datestring->date
   /Users/joe/Sites/racket/frog/exospheric/internetapocalypse/util-template.rkt:24:0: post-header
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/render.rkt:212:0: render-markup-or-markdown-source25
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/render.rkt:135:0: render20
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/private/cache-utils.rkt:99:2: fetch-dest-file
   /Applications/Racket/collects/file/cache.rkt:63:2: fetch-and-continue
   /Applications/Racket/collects/racket/contract/private/arrow-val-first.rkt:428:3
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/private/cache-utils.rkt:90:0: cache-ref!12
   /Applications/Racket/collects/racket/private/more-scheme.rkt:376:2: hash-ref!
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/render.rkt:71:0: render-from-source-or-output-path
   /Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/render.rkt:52:0: render-batch
   ...higher-order.rkt:357:33
   (submod "/Users/joe/Library/Racket/7.0/pkgs/pollen/pollen/private/command.rkt" raco): [running body]
   for-loop
   run-module-instance!125
   ...
Document: "about.html" is not a file!
otherjoel commented 6 years ago

OK, I believe I’ve fixed the issue with this last commit (as well as discovered a new one, #7). It hadn’t yet surfaced for me because it’s been awhile since I rendered those pages.

If you’re still getting the above error after pulling, let me know. If you receive any different errors, let’s open a separate issue for those.

jbshirk commented 6 years ago

Beautiful! Thank you!