I'm setting up an asciidoctor book which is arranged as follows:
= Title
== Foreword & Introduction
== Chapter 1:
== Chapter 2:
...
The problem is that when I create the HTML/PDF, the document will be indexed as follows:
Title
1 Foreword & Introduction
2 Chapter 1:
3 Chapter 2:
So, as you can see, all chapters have an offset of "1" caused by the Foreword chapter. Is there a way to get around this, maybe excluding the Foreword from the Chapter count, or using an alphabetic counting just for the Foreword and starting the following ones from "1". Or anything else that could make the final result look better.
Thanks
Lucky me! I just found it when I was searching for something even different:
[dedication%untitled]
Related
I am doing some BDD but i've come across an issue i can't solve.
I am trying to write this as my gherkin line that's visible in the step defintions:
When the user has 2 overdue books where the fine is payed (fine is 0)
But the text comes out to
the user has {int} overdue books where the fine is payed \\(fine is {int})
i've tried to escape with a backslash in front of the character and stringified the integers but that just converts them to strings.
Cucumber is being helpful by suggesting what it thinks you might want your step definition to be. You don't have the follow it. This is also a valid cucumber-expression:
the user has 0 overdue books where the fine is payed \\(fine is 0)
I'd like to do something like this:
These are the problems:
1. Too much concrete
2. Too few plants
...
This was also stated in Problem 1 and Problem 2.
The "Problem 1" and "Problem 2" should be links to the list above.
Output
syntax
These are the problems:
. [[prob1, Problem {counter:prob}]] Too much concrete
. [[prob2, Problem {counter:prob}]] Too few plants
This was also stated in <<prob1>> and <<prob2>>.
Explanation
prob1 and prob2 are IDs for the problems. You can freely choose them. E.g. prob_concrete and prob_plants. That way they would be easier to use.
{counter:prob} is the syntax for counting the counter called prob. You can freely choose the countername. (See "Counters" of the documentation)
Problem {counter:prob}: This is the part, that defines, how the reference is shown, when used (see image above).
I am new in python scripting and I trying to figure out w basics about a program source code.
I am struggling to understand these two expressions:
First :
index = [0]*3, It creates an index but how?
Second :
random.random_shuffle(mylist[-1]), what does "-1" mean? The last item in the list?
Many thanks in advance
Well, you are right in one case. Although nothing in your code uses a dictionary. But, maybe these examples will help clear things up.
my_zeroes = [0]*3
assert my_zeroes == [0, 0, 0]
assert [0, 1, 2, 3][-1] == 3
In the first line the syntax you have here will create a list containing three zeroes. Your statement First : index = [0]*3, It creates an index doesn't really make sense. Indexes are inherent to certain data structures like lists and tuples, for example, you don't 'create' them as such. But hopefully my example makes it a bit clearer what is happening here.
In the second line we just check the above fact is true. If it wasn't true it would throw an AssertionError, so assert is a useful debugging tool.
In the third line we assert the answer to your second question: [some_list][-1] does indeed perform a negative index into the last item of the list. Unless the list in question is empty in which case [][-1] will give you an IndexError, as will any other index for that matter while trying to index into the empty list.
You can check out the Python tutorial to get more familiar with the syntax. Good luck!
I am using cucumber-jvm and writing BDD tests.
I would like to write the step definition for "Then I should see three posts on a page" (The class name is Post)
So my best guess is:
expect(page).to have_css("tbody tr.#{Post}", count: 3)
But that does not work
how about:
element = all("tbody tr.#{Post}")
element.count
That should do the trick...
I am still new to Netlogo, but I can not find an explanation for this in the documentation.
I am trying to create a subset of an agentset that only contains one type of breed. It would seem that I could use "with" to perform this, but for some reason that does not work.
This code works:
ask link-neighbors with [shape = "person"][
set pmt (pmt + dist)
]
But this code does not:
ask link-neighbors with [breed = "psngrs"][
set pmt (pmt + dist)
]
How can I create a subset of an agentset with only this particular breed?
Thanks!
This question is showing as unanswered, though Alan gave the correct answer in a comment. So, just so I stop clicking on this thinking it is unanswered, I'm going to reiterate what he said as an answer. Alan, if you add your comment as answer, I'll happily delete mine.
Anyway, just get rid of the quotes around the breed name, like so:
link-neighbors with [breed = psngrs]