clehner / mksite

Declarative static site generator
https://celehner.com/mksite/README.html
Other
8 stars 1 forks source link

Sed in-place edit incompatibility on OSX #1

Open jthurst3 opened 9 years ago

jthurst3 commented 9 years ago

I have a simple _nav.txt file that contains the following contents:

. About
apply.html Apply
contact.html Contact
faq.html FAQ

After making a small modification to faq.md and running mksite, I get the following error:

rendering nav
sed: 1: "_nav.html": invalid command code _
make: *** [README.nav.html] Error 1
rm README.nav.html README.content.html

I believe this error is similar to what's described here, as I'm running on OSX and using BSD sed from May 10, 2005. Any ideas on how to fix?

clehner commented 9 years ago

It's probably because of \s and \S, which the 2005 sed doesn't support. bb also had this issue. I just pushed a sed-fix branch that uses [ \t] instead. Does that work?

jthurst3 commented 9 years ago

Doesn't seem to work. I get the same output.

clehner commented 9 years ago

sed: 1: "nav.html": invalid command code

looks like it's interpretting _nav.html as a command instead of as a filename. I'm replacing the filename now with <filename to put it in as stdin instead of as an argument. I'm testing with plan9 sed on Debian and see some other compatibility issues too.

clehner commented 9 years ago

How about now?

jthurst3 commented 9 years ago

Compiles and generates the static pages, but it is not correctly displaying bold text. Here is some sample input and output: sample.md:

**This should be in bold.**

relevant part of sample.html:

<p><strong></strong>This should be in bold.<strong></strong></p>
clehner commented 9 years ago

Ok, this would then be an issue with md2html.awk. I'm not sure what to do about that, other than suggest using a different markdown-to-html tool.

Edit: squashed and rebased the sed-fix branch onto master.

clehner commented 9 years ago

Yeah, md2html.awk seems to be relying on some GNU awk feature. I see the same result as you when using plan9's awk. Do you have gawk?