-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create a PDF file from Markdown documents (md2pdf) #11257
base: main
Are you sure you want to change the base?
Conversation
I don't think there's anything here I can meaningfully review (I don't know Docker), but I'm delighted to see it happening. |
That's fair. My primary intent was to let you know things are moving forward. I've removed your name from the reviewers. |
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.
Very nice work 👍
*** | ||
|
||
*[mics](https://github.com/michelou/)/January 2021* [**▲**](#top "Back to top") | ||
<span id="bottom"> </span> |
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.
The Back to top
seems not very useful, maybe remove it.
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.
While your comment is justified for people working with 20+ inch screens, I and others I guess are used to read online docs with a 5.8 inch cell phone, in which case this tiny button is very practical. I let you decide.
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.
Fair enough, it's fine to keep it.
pandoc/README.md
Outdated
<table style="margin-top:-10px; max-width:650px;"> | ||
<tr> | ||
<td><b>Input directories</b></td> | ||
<td><code>dotty/docs/docs/<project>/</code><br/><code>dotty/pandoc/data/</code></td> |
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.
<td><code>dotty/docs/docs/<project>/</code><br/><code>dotty/pandoc/data/</code></td> | |
<td><code>docs/docs/<project>/</code><br/><code>pandoc/data/</code></td> |
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.
Done.
pandoc/README.md
Outdated
</tr> | ||
<tr> | ||
<td><b>Output directory</b></td> | ||
<td><code>dotty/out/pandoc/</code></td> |
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.
<td><code>dotty/out/pandoc/</code></td> | |
<td><code>out/pandoc/</code></td> |
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.
Done,
--- | ||
layout: doc-page | ||
title: "Scala 3 Internals" | ||
titlegraphic: ../out/pandoc/images/scala-spiral.png |
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.
May it refer to pandoc/data/images/scala-spiral.png
directly?
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.
md2pdf
starts with a preprocessing phase which transforms :
- cross-references found in the Markdown files (e.g.
reference
) to named anchors - references to image files stored in
pandoc/data/images/
(e.g.scala-spiral.png
) to relative paths.
In short all references not starting with https://
are transformed before calling the pandoc
command line tool. In the output directory out/pandoc/
both directories images/
and src_managed/
are expected to be at the same level :
out/pandoc/images/
out/pandoc/src_managed/
out/pandoc/scala3_reference.pdf
pandoc/data/internals.md
Outdated
layout: doc-page | ||
title: "Scala 3 Internals" | ||
titlegraphic: ../out/pandoc/images/scala-spiral.png | ||
author: Martin Odersky and al. |
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.
author: Martin Odersky and al. | |
author: Martin Odersky et al. |
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.
Done.
pandoc/data/reference.md
Outdated
layout: doc-page | ||
title: "Scala 3 Reference" | ||
titlegraphic: ../out/pandoc/images/scala-spiral.png | ||
author: Martin Odersky and al. |
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.
author: Martin Odersky and al. | |
author: Martin Odersky et al. |
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.
Done.
pandoc/docs/PROJECT.md
Outdated
|
||
This project is located at the root of the [`lampepfl/dotty`][github_dotty] repository, at the same level as the [`Scala3doc`][github_scala3doc] project. | ||
|
||
## <span id="structure">Directory structure</span> |
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.
It would be nice to merge this with pandoc/README
, so that the reader has an overview on first read.
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.
Done.
@@ -0,0 +1,168 @@ | |||
# <span id="top">More about TeX Live</span> <span style="size:25%;"><a href="../README.md" title="Back to README">↩</a></span> | |||
<!-- created by mics (https://github.com/michelou/) on December 2020 --> |
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.
Is this document necessary given that we have the docker image?
@@ -0,0 +1,218 @@ | |||
@rem ## Created by mics (https://github.com/michelou/) on December 2020. |
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.
If image can be built by Linux/MacOS and published, then we don't need the script to build the image on Windows.
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.
My wish here is to offer different ways to developers to generate a PDF file from the Markdown files before they publish their changes (more details per email).
|
||
We provide two commands for MacOS/Ubuntu as well as their equivalents for MS Windows : | ||
- for *interactive users* :<br/>[`build {<option>|<subcommand>}`](./build) (resp. [`build.bat`](./build.bat) on MS Windows)<br/><span style="font-size:80%;">(option `-help` displays the available options/subcommands).</span> | ||
- for *automated tasks* (primarily, but not exclusively) :<br/>[`md2pdf [<project>]`](./md2pdf) (resp. [`md2pdf.bat`](./md2pdf.bat) on MS Windows)<br/><span style="font-size:80%;">(default value for `<project>` : `reference`).</span> |
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.
I've wondering, instead of having two commands build
and md2pdf
, can we have the same command for both local machines and cloud CI, assuming that both will use a published docker image?
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.
Your suggestion is right.
The existence of both commands build
and md2pdf
stems in part from my own background as a long-standing developer. Let me try to advocate the case (for fun) :
- as a preamble the existance of both scripts is not directly linked to Docker.
build
is a user-friendly wrapper script; it callsmd2pdf
but it also- provides some options (e.g.
-verbose
and-debug
) and some subcommands (e.g.clean
andview
on MS Windows); I typically run commandbuild -timer -verbose clean view
to generate filescala3_reference.pdf
on my Win10 laptop. - provides conditional compilation; the output file (e.g.
scala3_reference.pdf
) is generated depending on input file timestamps.
- provides some options (e.g.
md2pdf
is the minimal script for runningpandoc
with the appropriate settings.
In the context of the Dotty project, we can indeed have only one shell script : md2pdf
(and may be md2pdf.bat
).
NB. I could even omit several type checks environment checks inmd2pdf
assuming users can help themselves in case of errors.
- Register class type parameters from outer contexts in typedDefdef. - Remove a condition to support gadt approximation for class type parameters. - Add test cases in tests/pos/class-gadt. - Ignore test cases tests/pos/i4345.scala and i5735.scala (issue scala#11220 and scala#11221)
Co-authored-by: Allan Renucci <allanrenucci@users.noreply.github.com>
Make sure that something is a language import if and only if it looks like one. i.e. is of one of the forms import language.xyz import scala.language.xyz import _root_.scala.language.xyz
Avoid a notation of "owner" when checking for a language feature. Instead, allow qualified names for language features, e.g. `experimental.dependent".
The bit is set if - -Yexplicit-nulls is set - we are not in an `import.unsafeNulls` scope
Hi @michelou do you have any time to continue working on this? |
@michelou what's the status on this one? Are you still working on it? Do you need someone to review it? |
Short status is as follows :
In resume I need a co-worker ready to help me with step 2. |
@michelou I think I can help with getting the PDF generation working in Docker / CI. I have a branch from quite a while ago where I had this working....once I find it are you ok with me pushing the changes to this PR? |
@anatoliykmetyuk @liufengyun @griggt Today I updated my locally generated PDF file Next steps :
|
Here is an actualized version of the locally generated PDF file @griggt I finally have to bring myself to abandon my attempts with Docker. In short your help is welcome ! |
@michelou happy to help, but it may be days or weeks before I have a chance to look at this again. |
Hello! It's been about a year of inactivity here, so I just wanted to check if this should be closed, if someone plans on returning to this, etc? |
I just updated my GitHub project to (locally) generate the actualized PDF file I plan to look at the recently added pages and submit a few additions/corrections. |
WIP
The
pandoc
subproject make it possible to create a PDF file (e.g.scala3_reference.pdf
) from the Markdown documents of the Scala 3 documentation (internals
,reference
,usage
).Todo :
pandoc.yaml
to run CI job with GitHub Actions.Related to :