Coder Social home page Coder Social logo

Markdown tables about paip-lisp HOT 13 OPEN

norvig avatar norvig commented on August 24, 2024 1
Markdown tables

from paip-lisp.

Comments (13)

norvig avatar norvig commented on August 24, 2024 2

I've found that markdown rendering for tables on github has been problematic. I'm glad you are trying to sort this out. Thank you!

from paip-lisp.

pronoiac avatar pronoiac commented on August 24, 2024

Hmm, looks like this is an open and unanswered question! I think I'd put the caption as free text under the table, maybe with a leading "Table: ".

It looks like Github isn't rendering the table right now, missing the header row - adding an empty row like | | | appears to help. Adding that sort of empty row also might render better than the rows of |---|.

Sorry that you're stumbling on an unclear spot in Markdown parsers! Thanks for editing and the column alignment!

from paip-lisp.

HM0880 avatar HM0880 commented on August 24, 2024

@pronoiac

Happy to help! PAIP is a great book.

Updates:

  • The table rendering is fixed. I removed the dashes, tried blank rows, and finally chose no separation between the sections. See [1].

  • The print version of PAIP uses Figure for tables (e.g., "Figure 7.1: Glossary for the STUDENT program"), so I have kept the Figure label. Let me know if you want Table instead, and I will update.

  • I do not know how to handle the reference to the table. The previous reference was [figure 7.1](#f0010) (see below), and the current version is at [2].

    The program is summarized in [figure 7.1](#f0010).

    | []()                                         |
    |----------------------------------------------|
    | ![f07-01](images/chapter7/f07-01.jpg)        |
    | Figure 7.1: Glossary for the STUDENT Program |

[1] https://github.com/HM0880/paip-lisp/blob/main/docs/chapter7.md
[2] https://github.com/HM0880/paip-lisp/blob/main/docs/chapter7.md?plain=1#L118

from paip-lisp.

pronoiac avatar pronoiac commented on August 24, 2024

#f0010 isn't great; other chapters have that, and that might confuse things in Pandoc, which concatenates all the chapters in its workflow. How about #figure-07-1? Mimicking the links for footnotes, something like:

The program is summarized in [figure 7.1](#figure-07-1).

<a id="figure-07-1"></a>
[table]
Figure 7.1: Glossary for the STUDENT Program

Though if you opted to skip the link because it's right there, it's understandable.

from paip-lisp.

HM0880 avatar HM0880 commented on August 24, 2024

@pronoiac

I have chosen to follow the PAIP book convention: do not reference "close" figures (i.e., figures 23.1 and 23.2) but do reference "far away" figures (i.e., figure 23.3). (I wrote this choice in HM0880@95da530)

I have a question about the screenshots of the tables: the screenshots are referenced in the PAIP-safari.md document [1] (e.g., line 5631 references figure 04-02 [2]). I have been deleting the screenshots as I update the tables. Should I keep the screenshots so that existing scripts for export to different formats still work?

[1] https://github.com/norvig/paip-lisp/blob/main/PAIP-safari.md
[2] https://github.com/norvig/paip-lisp/blob/main/docs/images/chapter4/f04-02.jpg

from paip-lisp.

pronoiac avatar pronoiac commented on August 24, 2024

This reminds me that I should probably document how I go from the epub to the chapter markdown files, but not today...

For the purposes of review, I might hold off on deleting the table gifs, for a separate PR. If you've already deleted them, don't worry about it; I can compare to a local branch.

The chapter markdown files are where almost all editing happens; the book-long markdown file isn't kept in sync. When I've generated epub or pdf files, it was from the chapters. And when I replaced formulae with vector images, I deleted the old gifs; it makes it easier to skim pixelated images and see what could be redone and fixed up.

Have you had any issues with legibility on the scan?

from paip-lisp.

HM0880 avatar HM0880 commented on August 24, 2024

For the purposes of review, I might hold off on deleting the table gifs, for a separate PR. If you've already deleted them, don't worry about it; I can compare to a local branch.

OK. I added the table images back to my repo to make the future merge request easier.

The chapter markdown files are where almost all editing happens; the book-long markdown file isn't kept in sync. When I've generated epub or pdf files, it was from the chapters. And when I replaced formulae with vector images, I deleted the old gifs; it makes it easier to skim pixelated images and see what could be redone and fixed up.

There are also some other images (e.g., [1]) that could be drawn with something like Mermaid [2]. Would redrawing these sorts of images be useful?

Have you had any issues with legibility on the scan?

No, the tables have been very legible. I also have a print copy of the book so I can compare against the printed version if needed.

EDIT: Figure 12.1 has a make-= in the "Auxiliary Functions" section, but the = is not readable at all.

[1] Chapter 2 tree image
[2] https://mermaid-js.github.io/mermaid/

from paip-lisp.

pronoiac avatar pronoiac commented on August 24, 2024

There are also some other images (e.g., [1]) that could be drawn with something like Mermaid [2]. Would redrawing these sorts of images be useful?

It's a good idea! (And totally a separate branch, btw.) It's been somewhere on my todo list for ages. I could see using Mermaid or Graphviz for some figures, and perhaps draw.io diagrams.net for more general drawing.

(I have a lot of bookmarks and thoughts about diagrams, but I won't dump them all here.)

from paip-lisp.

HM0880 avatar HM0880 commented on August 24, 2024

I like Graphviz for its longevity, but the dynamic scaling of images produced by a Javascript solution is appealing.

I created Issue #139 for more discussion.

from paip-lisp.

pronoiac avatar pronoiac commented on August 24, 2024

I've been making lots of small edits, and that can tangle up PRs with merge conflicts, and that makes me want to aim at shorter-lived branches. Is there anything that would help with the effort for turning images into markdown tables?

from paip-lisp.

HM0880 avatar HM0880 commented on August 24, 2024

Is there anything that would help with the effort for turning images into markdown tables?

My initial plan was to do a PR for all the tables at once, but I plan to do a PR now for the tables that I have completed to keep up-to-date with the repo.

Edit: Opened PR #148

from paip-lisp.

pronoiac avatar pronoiac commented on August 24, 2024

I'm thinking about making new ebooks in a month or so. How's it going?

from paip-lisp.

HM0880 avatar HM0880 commented on August 24, 2024

Hi @pronoiac, sorry for the delay. After mid-August, I would have more time to work on the tables.

from paip-lisp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.