Git Product home page Git Product logo

Comments (9)

bennn avatar bennn commented on June 15, 2024

Can you post the code, or a link to it?

from scribble.

zoeeer avatar zoeeer commented on June 15, 2024

https://github.com/zoeeer/git-from-the-bottom-up-translate

I just pushed it to this repo. Please look at the file at path "docs/1.repository.scrbl". Thanks.

---edit---

Here's the code about footnotes:

At the top of this file:

@(define-footnote notes2 footnotes2)
@(define-footnote notes3 footnotes3)
@(define-footnote notes4 footnotes4)
@(define-footnote notes5 footnotes5)

defines footnote for several sections. And after the text of certain section there is:

@(footnotes2)

@section{...}  @;begins the next section

specifies where to show the footnotes. Then just as the picture shows, section number jumped by one when there is a footnote-part.

I also have footnotes for section 2.1, but I put this subsection in a separate file and then included it (I actually did this to test the "footnote - section number" thing):

@title{代码仓库(repository)}

@include-section["1-1-content-tracking.scrbl"]

@section{blob的介绍}

And this works fine - the following section is numbered 2.2.

from scribble.

bennn avatar bennn commented on June 15, 2024

Ok, I think the change in #84 will fix this. Can you edit your copy of scriblib/footnote.rkt and try it?

The issue seems to be, calling @(footnotes2) is the same as adding @section[#:style '(hidden toc-hidden)]{}. This "hidden" section gets a section number, so the section after it gets an incremented number.

Adding @section[#:style '(unnumbered hidden toc-hidden)]{} doesn't change the section numbers, and that's what the pull request does.

from scribble.

zoeeer avatar zoeeer commented on June 15, 2024

Thank you bennn, I read your PR and I think it will fix.

But, please excuse me, I don't know how to build and use the latest code. Is there anything in the racket docs which can guide me through this?

I read some parts of the Package Management in Racket, and I figure I need to remove the official package and install it from my local repository, is that right? Do I remove only scribble-lib or I need to remove the whole scribble package?

Actually I tried:

$ raco pkg remove --force scribble-lib
$ raco pkg install  # under path $(scribble-repo)/scribble-lib

Everything seems right. But then when I ran scribble command from shell, it says the command cannot be found. Where did I go wrong?

---edit---

Now I tried adding the "unnumbered" argument into the installed directory of Racket. It works as expected.

from scribble.

zoeeer avatar zoeeer commented on June 15, 2024

@bennn Now that you've mentioned an 'unnumbered' option , I wonder if it can be used with a section included by the @include-section syntax? 'cause I have an 'introduction' section in the beginning of my document and I don't want it to be numbered.

from scribble.

bennn avatar bennn commented on June 15, 2024

To work with the latest scribble**

  • clone Racket
  • inside the clone directory, make a folder extra-pkgs/
  • inside the extra-pkgs/ folder, run raco pkg update --clone scribble

Yes, you can use 'unnumbered' on any section. I think the full list of style options is in the docs for the part struct:
http://docs.racket-lang.org/scribble/core.html#%28def._%28%28lib._scribble%2Fcore..rkt%29._make-part%29%29

(All this should be easier to find .... idk the best solution. Write blog posts? Ask questions on Stack Overflow?)

** Those instructions are what I did, and I think probably what you want to do. But I'm not sure it's necessary to clone Racket. And it's definitely not necessary to make an extra-pkgs/ directory or even to call it that, but extra-pkgs/ is included in the .gitignore in the Racket repo. Also, you can do raco pkg install --clone <pkg-name> for new packages. ... There's an email from Sam from 2014(?) that suggests extra-pkgs/.

from scribble.

zoeeer avatar zoeeer commented on June 15, 2024

Thanks, that's a lot of information...

I grabbed the idea of "part" objects, and it says

"There is no difference between a part and a full document; a particular source module just as easily defines a subsection (incorporated via include-section) as a document."

But I still don't know how to add a "style" option to the whole included-document-as-a-part-object. The doc for @include-section says:

(include-section module-path)
Requires module-path and returns its doc export (without making any imports visible to the enclosing context). Since this form expands to require, it must be used in a module or top-level context.

It seems to me that @include-section["path/to/file"] just expands to something like (require "path/to/file"), right? The following code generates a "bad syntax" error:

 @include-section[#:style 'unnumbered "path/to/file"]

from scribble.

bennn avatar bennn commented on June 15, 2024

Yes include-section is basically a require.

I don't know how to add a style to a whole included document either. I would add #:style tags to each section, or redefine @section etc. at the top of the Introduction. Like:

#lang scribble/manual
@(require (prefix-in base: scribble/base))

@(define (section . stuff)
   (apply base:section #:style 'unnumbered stuff))

from scribble.

bennn avatar bennn commented on June 15, 2024

#84

from scribble.

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.