-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Asymptote diagrams #61
Merged
LaurentRDC
merged 19 commits into
LaurentRDC:master
from
mgajda:michal/asymptote-support
Oct 25, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d642f4e
First try at Asymptote.
mgajda f6a04e8
Working asymptote except for incompatible save format error.
mgajda 3a87e27
Completed test suite.
mgajda 2a8ff6e
First attempt at adding Asymptote to CI.
mgajda e2c887d
Attempt CI testing Asymptote on macOS.
mgajda ba67216
Fixed sudo brew on Mac.
mgajda e12caeb
Merge branch 'master' into michal/asymptote-support
LaurentRDC b4bbcc9
Fix saving output format in Asymptote
mgajda bd6cbc6
Test all advertised output formats
mgajda 80128cf
Merge branch 'michal/asymptote-support' into HEAD
mgajda 158a205
Fixed a list of advertised formats for GGPlot and Matplotlib.
mgajda 0a8e7dc
Sow version of Graphviz, Asymptote and PlantUML in CI.
mgajda 8f93380
Skip tests that do not work on CI until we upgrade it.
mgajda 20028af
Also skip Matlab SVG test that fails on Ubuntu CI.
mgajda 6a8d501
Debug asy -environment
mgajda c7f1f48
Fix accidental mistake
mgajda 7bcc602
Add debugging for asymptote on Windows.
mgajda 4cc59f7
Show path on Ubuntu CI
mgajda 4920ed6
Close testing of CI in favour of another PR.
mgajda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ test-show-details: streaming | |
|
||
jobs: $ncpus | ||
|
||
allow-newer: haddock-library:base, | ||
allow-newer: haddock-library:base, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE QuasiQuotes #-} | ||
{-# LANGUAGE RecordWildCards #-} | ||
{-# LANGUAGE NoImplicitPrelude #-} | ||
|
||
-- | | ||
-- Module : $header$ | ||
-- Copyright : (c) Laurent P René de Cotret, 2019 - present | ||
-- License : GNU GPL, version 2 or above | ||
-- Maintainer : [email protected] | ||
-- Stability : internal | ||
-- Portability : portable | ||
-- | ||
-- Rendering Asymptote plots code blocks | ||
module Text.Pandoc.Filter.Plot.Renderers.Asymptote | ||
( asymptote, | ||
asymptoteSupportedSaveFormats, | ||
) | ||
where | ||
|
||
import Text.Pandoc.Filter.Plot.Renderers.Prelude | ||
import Data.Char(toLower) | ||
|
||
asymptote :: PlotM Renderer | ||
asymptote = do | ||
cmdargs <- asksConfig asyCmdArgs | ||
return | ||
$ Renderer | ||
{ rendererToolkit = Asymptote, | ||
rendererCapture = asymptoteCapture, | ||
rendererCommand = asymptoteCommand cmdargs, | ||
rendererAvailability = CommandSuccess $ \exe -> [st|#{pathToExe exe} -environment|], | ||
rendererSupportedSaveFormats = asymptoteSupportedSaveFormats, | ||
rendererChecks = mempty, | ||
rendererLanguage = "asy", | ||
rendererComment = mappend "// ", | ||
rendererScriptExtension = ".asy" | ||
} | ||
|
||
asymptoteSupportedSaveFormats :: [SaveFormat] | ||
asymptoteSupportedSaveFormats = [PDF, EPS, PNG] | ||
|
||
asymptoteCommand :: Text -> OutputSpec -> Text | ||
asymptoteCommand cmdArgs OutputSpec {..} = | ||
[st|#{pathToExe oExecutable} #{cmdArgs} -f #{toLower <$> show (saveFormat oFigureSpec)} -o "#{oFigurePath}" "#{oScriptPath}"|] | ||
|
||
-- Asymptote export is entirely based on command-line arguments | ||
-- so there is no need to modify the script itself. | ||
asymptoteCapture :: FigureSpec -> FilePath -> Script | ||
asymptoteCapture FigureSpec {..} _ = script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove commented-out commands?