unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Customizing Haunt to work with Skribilio
@ 2020-08-17 19:59 Joshua Branson
  2020-08-18  6:54 ` pukkamustard
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Branson @ 2020-08-17 19:59 UTC (permalink / raw)
  To: help-guix

Hello,

I am trying to use the lovely haunt static site generator with
Skribilio!  And I noticed that the default haunt as packaged by guix,
does not work with Skribilio.  I made a customized version of
Skribilio that would work with Haunt.

https://notabug.org/jbranso/guix-packages/src/master/packages/haunt.scm

But I am still getting an error message:

#+BEGIN_SRC sh
joshua@dobby ~/prog/org/projects/generate-income/client-site$ haunt build
building pages in 'site'...
Backtrace:
           5 (primitive-load "/gnu/store/4vvbcxrqjm8dbc1g1gk9pakqgf7…")
In haunt/ui.scm:
    124:6  4 (run-haunt-command _ . _)
In haunt/ui/build.scm:
     60:4  3 (haunt-build . _)
In haunt/site.scm:
   100:19  2 (build-site #<<site> title: "Built with Guile" domain: …>)
In ice-9/ftw.scm:
   482:39  1 (loop _ _ #(2050 2907188 16877 2 1000 998 0 4096 # # …) …)
In unknown file:
           0 (scm-error misc-error #f "~A ~S" ("no reader availa…" …) …)

ERROR: In procedure scm-error:
no reader available for post:  "posts/jolly-good-day.skr"
#+END_SRC

What am I doing wrong?

Thanks,

Joshua

P.S.  I also made a video of be building this custom haunt package:

https://video.hardlimit.com/videos/watch/e9923058-45bd-4a55-ad73-f2bc050e91a6


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Customizing Haunt to work with Skribilio
  2020-08-17 19:59 Customizing Haunt to work with Skribilio Joshua Branson
@ 2020-08-18  6:54 ` pukkamustard
  2020-08-18 15:38   ` Joshua Branson
  0 siblings, 1 reply; 3+ messages in thread
From: pukkamustard @ 2020-08-18  6:54 UTC (permalink / raw)
  To: Joshua Branson; +Cc: help-guix


Hi Joshua,

> I am trying to use the lovely haunt static site generator with
> Skribilio!

Cool! I've been tinkering with the same idea the last couple of 
days.
In particular using the Skribilo outline reader to build websites 
from
org-mode files with haunt.

> But I am still getting an error message:
>
> #+BEGIN_SRC sh
> joshua@dobby ~/prog/org/projects/generate-income/client-site$ 
> haunt build
> building pages in 'site'...
> Backtrace:
>            5 (primitive-load 
>            "/gnu/store/4vvbcxrqjm8dbc1g1gk9pakqgf7…")
> In haunt/ui.scm:
>     124:6  4 (run-haunt-command _ . _)
> In haunt/ui/build.scm:
>      60:4  3 (haunt-build . _)
> In haunt/site.scm:
>    100:19  2 (build-site #<<site> title: "Built with Guile" 
>    domain: …>)
> In ice-9/ftw.scm:
>    482:39  1 (loop _ _ #(2050 2907188 16877 2 1000 998 0 4096 # 
>    # …) …)
> In unknown file:
>            0 (scm-error misc-error #f "~A ~S" ("no reader 
>            availa…" …) …)
>
> ERROR: In procedure scm-error:
> no reader available for post:  "posts/jolly-good-day.skr"
> #+END_SRC
>
> What am I doing wrong?

You need to add the `skribe-reader` to the list of readers in your 
site configuration:

```
#:readers (list commonmark-reader skribe-reader)
```

Haunt does not use Skribilo and it is not necessary to add 
skribilo as
input when building haunt. Haunt has it's own parser for the 
skribe
format 
(https://git.dthompson.us/haunt.git/tree/haunt/reader/skribe.scm).

The problem is that haunt does not know what to do with the *.skr 
file
("no reader available").

I've been doing some poking around into using Skribilo directly 
from
haunt. This is the basic idea:

```
(define-module (my-skribilo-reader)
  #:use-module (haunt reader)
  #:use-module (skribilo reader outline))

;; Make a haunt reader
(define haunt-outline-reader
  (make-reader
   (make-file-extension-matcher "org")
   (lambda (file)
     (let ((outline-reader (make-outline-reader))) ; This is the 
     Skribilo reader
       (do-some-processing-to-create-a-haunt-post
        (with-input-from-file file outline-reader))))))
```

Hope that helps,
-pukkamustard

PS: Would you be interested in porting Skribilo to Guile 3.0? I'm 
struggling with that and could use some help.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Customizing Haunt to work with Skribilio
  2020-08-18  6:54 ` pukkamustard
@ 2020-08-18 15:38   ` Joshua Branson
  0 siblings, 0 replies; 3+ messages in thread
From: Joshua Branson @ 2020-08-18 15:38 UTC (permalink / raw)
  To: help-guix

pukkamustard <pukkamustard@posteo.net> writes:

> Hi Joshua,
>
> You need to add the `skribe-reader` to the list of readers in your
> site configuration:
>
> ```
> #:readers (list commonmark-reader skribe-reader)
> ```

Thanks that fixed it!

>
> Hope that helps,
> -pukkamustard
>
> PS: Would you be interested in porting Skribilo to Guile 3.0? I'm
> struggling with that and could use some help.
>

Yes!  I would be!  (Please bear in mind I'm saying "yes" to everyone who
asks me for help).  But sure.  Why not?  "You can have whatever you
want, as long as you help enough other people get what they want."  -Zig
Ziglar.  I'm free most mornings for the next few days, but my priority
is finishing a website for a client.  Let me know how I can help.


-- 
Joshua Branson
Sent from Emacs and Gnus


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-18 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 19:59 Customizing Haunt to work with Skribilio Joshua Branson
2020-08-18  6:54 ` pukkamustard
2020-08-18 15:38   ` Joshua Branson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).