Skip to content
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

Pimp codeexamples (issue #640) #711

Closed
wants to merge 27 commits into from
Closed

Pimp codeexamples (issue #640) #711

wants to merge 27 commits into from

Conversation

Mo-Gul
Copy link
Contributor

@Mo-Gul Mo-Gul commented Jul 16, 2019

everything important is written in the comments to issue #640.

Mo-Gul added 15 commits June 24, 2019 20:58
…s in `extract.lua`

- started adding libraries to the codeexamples
  (so far not all needed styles and definitions were added using `pre` key)
…r files fail TeXing using the build bash script.

! `pre` stuff containing (double) hashes fail in automatic testing, because single hashes are needed there
! first `codeexample` in `pgfmanual-en-xxcolor.tex` isn't extracted
  (Is this a bug in `extract.lua`? Are there more `codeexamples` elsewhere that are not extracted?)
! second `codeexample` in pgfmanual-en-xxcolor.tex` shows spurious "-6pt-6pt" in the PDF in front of the `minipage` when TeXing the extracted file
  - incorporated fixes from main PGF repository (provided by Henri)
  - changed `\documentclass` from `article` to `standalone`
  - reordered some stuff
- started switching from `libraries/tikz={...}` to `preamble={\usetikzlibrary{...}}`
…kzlibrary{...}}`

- continued with following files in the manual
- continued adding code to make extracted `codeexample`s work
  (so they can be found more easily)
…unt for the manual files at `/tex/generic/pgf/graphdrawing/lua/pgf/`

- accounted for some more `codeexample`s in `doc/generic/pgf/text-en/`
Copy link
Member

@hmenke hmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great effort, but as it stands it still needs a bit of work before it is ready to merge.

doc/generic/pgf/extract.lua Outdated Show resolved Hide resolved
doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex Outdated Show resolved Hide resolved
@hmenke
Copy link
Member

hmenke commented Jul 16, 2019

You should also enable Travis CI for your repository so that the automated checks are run. Right now the manual fails to build. Go to https://travis-ci.com/Mo-Gul/pgf, sign in with GitHub and follow the instructions to enable it.

@Mo-Gul
Copy link
Contributor Author

Mo-Gul commented Jul 18, 2019

Thank you for the Travis CI hint. It works fine. But after some more changes (as you can see) now I don't have a clue any more why my Travis CI checks don't succeed. Could you please have a look at them and give me a hint!?

I also want to note that LuaLaTeXing the last commits on my (local) machine works perfectly fine. The last commit results in a 1302 pages PDF and the only "error" I get in my LOG is

Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)

@hmenke
Copy link
Member

hmenke commented Jul 18, 2019

https://travis-ci.com/Mo-Gul/pgf/jobs/217394242#L1952-L1968

[398] [399] [400].../tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua:28
: attempt to call a nil value
stack traceback:
	.../tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua:28: in main chunk
	[C]: in function 'require'
	...phdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua:241: in metamethod
 '__index'
	...ul/pgf/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua:386: in field 'ren
derer'
	...ul/pgf/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua:588: in upvalue 'r
ender_infos'
	...ul/pgf/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua:74: in function 'p
gf.manual.DocumentParser.include'
	[\directlua]:1: in main chunk.
\includeluadocumentationof ...Parser.include '#1'}
                                                   
l.181 ...uadocumentationof{pgf.gd.control.Anchoring}

@Mo-Gul
Copy link
Contributor Author

Mo-Gul commented Jul 19, 2019

Thank you for that but unfortunately that doesn't help me much. When I look at line in tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua it just states "documentation" and the following documentation block looks fine for me.

If you know what exactly causes the problem it would be nice if you could state me the solution. If I have to search for the problem myself this would mean that I have to do an unknown number of commits where I comment different parts until I maybe have found it in the Travis CI logs, because -- as I mentioned already -- I do not get any of these errors on my computer ...

Copy link
Member

@hmenke hmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that you reverted several bugfixes as part of this PR. This has to be fixed.

@hmenke
Copy link
Member

hmenke commented Jul 19, 2019

Actually you reverted almost all the bugfixes from the 3.1.4 release.

@Mo-Gul
Copy link
Contributor Author

Mo-Gul commented Jul 19, 2019

To the last 4 comments:
I am not a Git(Hub) expert and I know that at least at one point I most likely did bullshit. I merged the 'master' into the 'PimpCodeexamples' branch instead of the other way round. But hopefully I could revert that.

And I hopefully did not revert all the bugfixes, but they are just not implemented yet, because I am x commits behind the master ...

If I really should have created a mess it would be great if you could help me. But in principle everything should be fine when only the documentation files can -- later, when I am again through all the files -- accepted in the pull request. Maybe I can even just provide these files in the pull request. We'll see.

Please advice if I can resolve the last two items or do it yourself when everything is fine with that (again), thanks.

@Mo-Gul
Copy link
Contributor Author

Mo-Gul commented Jul 19, 2019

One more thing. Providing all the stuff not with setup code and optionally hidden makes it a bit harder. Thus it would be great if I could do a diff of the PDFs before and after my changes. Therefore I need to suppress the output of preamble when TeXing the manual. Could you please state me how I can do this. Many thanks in advance!

@hmenke
Copy link
Member

hmenke commented Jul 20, 2019

Printing of the preamble option is handled here:

\ifx\code@preamble\pgfutil@empty\else
\pgfutil@tempdima=\hsize
\vbox{\hsize=\pgfutil@tempdima
\scriptsize\detokenize\expandafter{\code@preamble}}%
\fi

@Mo-Gul
Copy link
Contributor Author

Mo-Gul commented Jul 24, 2019

@hmenke , ok, I am through again. This time only 10 codeexamples remain, that I don't have a clue how to make them work. These are

  • pgfmanual-en-base-images-3.tex
  • pgfmanual-en-base-scopes-5.tex
  • pgfmanual-en-dv-visualizers-24.tex
  • pgfmanual-en-gd-algorithm-layer-2.tex
  • pgfmanual-en-gd-algorithm-layer-3.tex
  • pgfmanual-en-gd-overview-3.tex
  • pgfmanual-en-library-edges-5.tex
  • pgfmanual-en-library-rdf-26.tex
  • pgfmanual-en-tikz-actions-52.tex
  • pgfmanual-en-tikz-graphs-5.tex

Besides that there are some examples in

  • pgfmanual-en-dv-stylesheets.tex
  • pgfmanual-en-pgfsys-animations.tex

where a leading space seems to be added (see DiffPDF.pdf). I'll have a look at that later.

- had a look at the `codeexample`s where a leading space was introduced (see #711 (comment)). Some of them could be removed but others are introduced because of code added to the `pre` key where I don't have a clue if/how this can be avoided
…fault)

  - therefore added loading `graphs` library in `graphs.standard` library
  - adjusted `preamble` code in `codeexample`s accordingly
 - there exist `graphdrawing` `codeexample`s in the manual that don't need the `graphs` library --> adjusted `codeexample`s accordingly
@hmenke
Copy link
Member

hmenke commented Aug 4, 2019

You have to fix that botched merge 4dd4ac8 before I can consider this. You reverted all of the fixes of the 3.1.4 release.

… `pgfmanual-en-base-quick.tex`

Co-Authored-By: Henri Menke <henri@icp.uni-stuttgart.de>
@Mo-Gul
Copy link
Contributor Author

Mo-Gul commented Aug 5, 2019

As I have commented earlier in commit 2428348 I merged master into PimpCodeexamples, but because this was wrong way round I reverted this with commit 4dd4ac8. My hope was/is that the next merge -- this time the right way round -- will incorporate your fixes (again).

To avoid that I do some more bullshit regarding merges etc., I would appreciate it if you (@hmenke) could do the necessary work. To do so I (hopefully) invited you as collaborator to the fork.

@hmenke
Copy link
Member

hmenke commented Aug 20, 2019

Closed in favour of #729

@hmenke hmenke closed this Aug 20, 2019
hmenke pushed a commit to hmenke/pgf that referenced this pull request Aug 27, 2019
hmenke pushed a commit to hmenke/pgf that referenced this pull request Aug 27, 2019
hmenke pushed a commit to hmenke/pgf that referenced this pull request Aug 27, 2019
- had a look at the `codeexample`s where a leading space was introduced (see pgf-tikz#711 (comment)). Some of them could be removed but others are introduced because of code added to the `pre` key where I don't have a clue if/how this can be avoided
hmenke pushed a commit to hmenke/pgf that referenced this pull request Aug 27, 2019
@Mo-Gul Mo-Gul deleted the PimpCodeexamples branch September 8, 2019 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants