Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nebelhorn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
Nebelhorn
Commits
71fd59a9
Verified
Commit
71fd59a9
authored
8 months ago
by
Nicolas Lenz
Browse files
Options
Downloads
Patches
Plain Diff
feat: use pandoc-lua-engine
parent
2c29c0b8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3572
passed
8 months ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flake.nix
+15
-1
15 additions, 1 deletion
flake.nix
nebelhorn.cabal
+1
-1
1 addition, 1 deletion
nebelhorn.cabal
src/Build.hs
+6
-9
6 additions, 9 deletions
src/Build.hs
with
22 additions
and
11 deletions
flake.nix
+
15
−
1
View file @
71fd59a9
...
...
@@ -17,6 +17,20 @@
haskellProjects
.
default
=
{
packages
=
{
tztime
.
source
=
"0.1.1.0"
;
# version in nixpkgs is marked broken
#pandoc-lua-engine.source = "0.2.1.5";
};
settings
.
nebelhorn
=
{
/*
I'm not sure why, but since adding `pandoc-lua-engine` I need to manually remove these
packages or otherwise `justStaticExecutables` will lead to an error that the output
"is not allowed to refer to the following paths" from ghc.
*/
removeReferencesTo
=
[
pkgs
.
haskellPackages
.
pandoc-types
pkgs
.
haskellPackages
.
pandoc
pkgs
.
haskellPackages
.
tzdata
];
justStaticExecutables
=
true
;
};
devShell
=
{
mkShellArgs
=
{
...
...
@@ -25,7 +39,7 @@
};
};
packages
.
default
=
pkgs
.
haskell
.
lib
.
justStaticExecutables
self
'
.
packages
.
nebelhorn
;
packages
.
default
=
self
'
.
packages
.
nebelhorn
;
apps
.
default
=
self
'
.
apps
.
nebelhorn
;
packages
.
image
=
pkgs
.
dockerTools
.
buildImage
{
...
...
This diff is collapsed.
Click to expand it.
nebelhorn.cabal
+
1
−
1
View file @
71fd59a9
...
...
@@ -44,7 +44,7 @@ executable nebelhorn
, optparse-applicative
, pandoc
, pandoc-types
--
pandoc-lua-engine
will be needed for pandoc 3
,
pandoc-lua-engine
, path
, path-io
, process
...
...
This diff is collapsed.
Click to expand it.
src/Build.hs
+
6
−
9
View file @
71fd59a9
...
...
@@ -5,7 +5,7 @@ import Text.Pandoc.Definition
import
Text.Pandoc.Class
import
Text.Pandoc.Options
(
def
)
import
qualified
Text.Pandoc.Filter
as
Filter
import
Text.Pandoc.
Scripting
(
no
Engine
)
import
Text.Pandoc.
Lua
(
get
Engine
)
import
Nebelhorn
import
Util
import
Config
...
...
@@ -13,7 +13,7 @@ import Save
import
Path
import
Data.List
(
union
)
import
qualified
Data.Map
as
Map
(
singleton
,
empty
)
import
Control.Concurrent.Async
(
map
Concurrently
)
import
Control.Concurrent.Async
(
for
Concurrently
)
import
qualified
Data.Text
as
T
import
Data.Char
(
isAlphaNum
)
...
...
@@ -187,14 +187,11 @@ putIndex nebelhorn = mapPages putIndex' nebelhorn where
applyFilters
::
Nebelhorn
->
IO
Nebelhorn
applyFilters
nebelhorn
@
Nebelhorn
{
..
}
=
do
pages'
<-
(
runIOorExplode
<$>
apply
)
`
mapConcurrently
`
nebelhornPages
engine
<-
getEngine
pages'
<-
forConcurrently
nebelhornPages
$
runIOorExplode
<$>
\
page
@
Page
{
..
}
->
do
doc'
<-
Filter
.
applyFilters
engine
def
nebelhornFilters
[
"html"
]
pageDoc
return
page
{
pageDoc
=
doc'
}
return
nebelhorn
{
nebelhornPages
=
pages'
}
where
apply
::
(
PandocMonad
m
,
MonadIO
m
)
=>
Page
->
m
Page
apply
page
@
Page
{
..
}
=
do
doc'
<-
Filter
.
applyFilters
noEngine
def
nebelhornFilters
[
"html"
]
pageDoc
return
page
{
pageDoc
=
doc'
}
putFeeds
::
Nebelhorn
->
Nebelhorn
putFeeds
nebelhorn
@
Nebelhorn
{
..
}
=
nebelhorn
{
nebelhornFeeds
=
putFeed
<$>
nebelhornFeeds
}
where
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment