How can I create an Asciidoc table of contents from external files? - asciidoc

The Asciidoc :toc: command creates a nicely formatted table of contents from the headings in the document:
:toc:
= Part 1
= Part 2
= Part 3
But I want my table of contents to link to other documents, instead of pulling from the document itself:
link:part1.adoc[Part 1]
link:part2.adoc[Part 2]
link:part3.adoc[Part 3]
Is there a way to create a TOC from links to other files? If not, what styles/blocks/whatever can I use to mimic the style of the TOC as closely as possible?

Yes, however, it may not behave the way you intend.
= Document
:toc:
== link:part1.adoc[Part 1]
== link:part2.adoc[Part 2]
== link:part3.adoc[Part 3]
That produces a table of contents, but its links point to the headings in the same file: that's what the :toc: is for. The headings themselves are links to the other documents.
You can create your own list, but to approximate the styling of the on-page TOC, you need to create a docinfo.html file containing the CSS you'd like to use:
<style>
.mytoc ul {
list-style-type: none;
margin-left: 0;
font-family: sans-serif;
}
.mytoc li {
margin: 0;
padding: 0;
}
</style>
and specify that you want to use the docinfo file:
= Document
:docinfo: shared
[.mytoc]
== Table of Contents
* link:part1.adoc[Part 1]
* link:part2.adoc[Part 2]
* link:part3.adoc[Part 3]
Note that the styles I included aren't a comprehensive recreation of the the on-page TOC's styles, but hopefully they are enough to show you the way.
See https://asciidoctor.org/docs/user-manual/#docinfo-file for more information on docinfo files.

Related

meaning of *= in the below snippet in SCSS

I am new to scss. What is the meaning of *= in the below code ?
div[class*="SnackbarItem-contentRoot"] {
width: 600px;
&[class*="SnackbarItem-variantError"]{
background-color: $orange;
color: $white;
}
}
*= is not SCSS features, it is an attribute selectors used in CSS.
For example, this will select all a element with href attribute whose value contains at least one occurrence of example and apply font size to 2em
a[href*="example"] {
font-size: 2em;
}
In our case, *= means get all div with class whose value contains at least one occurrence of "SnackbarItem-contentRoot"
However &, a parent selector invented by Sass that’s used in nested selectors.
&[class*="SnackbarItem-variantError"] means get all div with class whose value contains at least one occurrence of "SnackbarItem-contentRoot"
Your can find more information about attribute selectors here
> This is CSS Attribute Selector.
It is used to select all html elements whose Attribute or class Attribute is "className" or html Attribute name.
where * means 'All' and '=' match Attribute value.
e.g - it select all div whose className is 'SnackbarItem-contentRoot'
div[class*="SnackbarItem-contentRoot"] {
background: yellow;
width:600px;
}
So, you can use this selector in css as well as in scss file.

Change column color in Oracle apex

How can I change the background color of every second column using interactive report.
First of all I recommend using css. If you don't like CSS just go directly to IR section in my answer
CSS
th:nth-child(even),
td:nth-child(even){
background-color: red !important
}
or
th:nth-child(2),
td:nth-child(2) {
background-color: red !important
}
th:nth-child(4),
td:nth-child(4) {
background-color: blue !important
}
or
th#C152380905075548116,
td[headers="C152380905075548116"] {
background-color: red !important;
}
th#C152381026269548117,
td[headers="C152381026269548117"] {
background-color: blue !important;
}
where C152380905075548116 and C152381026269548117 are columns id that should be replaced.
IR
If you really need to use native IR functionalities you should follow 3 steps:
Change report SQL query so the column contains name of the color you want to use as background
eg:
select
...
VALUE1||'<span style="display: none">red</red>' as Artikl
VALUE2||'<span style="display: none">blue</red>' as "Broj gresaka"
..
from
..
Add IR highlights Actions > Format > Highlight
Name = Red background (Artikl)
Sequence = Sequence
Enabled = Yes
Highlight Type = Cell
Background Color = #FF7755
Text Color = null
Column = Artikl
Operator = Contains
Expression = red
and
Name = Blue background (Broj gresaka)
Sequence = Sequence
Enabled = Yes
Highlight Type = Cell
Background Color = #99CCFF
Text Color = null
Column = Artikl
Operator = Contains
Expression = blue
Set columns attribute Security > Escape special characters to No
It is not the perfect solution but it works :-)

What is ">ul" means in SASS?

Here is the SASS code part:
#main-nav{
>ul{
blahblah
}
}
So I want to know the exact mean of the string ">ul" means? I cannot find it in the SASS manual.
Furthermore, can it be translated to stylus?
This the CSS syntax to select the child of an element. See this reference for more on how it works:
This selector matches all elements that are the immediate children of
a specified element. The combinator in a child selector is a
greater-than sign (>). It may be surrounded by whitespace characters,
but if it is, Internet Explorer 5 on Windows will incorrectly treat it
as a descendant selector. So the best practice is to eschew whitespace
around this combinator.
#main-nav {
> ul {
color: red;
}
}
The same in CSS:
#main-nav > ul { color: red }
About > selector you can read here http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/ (#8)

Using SASS Variables within nth-child?

I have a grid set up of thumbnail images, currently 4 thumbs per row. To make sure they line up i have this snippet of code:
li:nth-child(5) { margin-left: 0;}
What I have tried to do is this but I am getting a syntax error:
$galleryGrid: 5;
li:nth-child($galleryGrid) { margin-left: 0;}
If I wanted to alter the nth-child to use another value, such as 10 (so I can have 8 thumbs in a row), I assumed this would work.
Is this not possible or am I just doing incorrectly?!
Thanks in advance for you help.
You need to use variable interpolation to allow nth-child to be a variable.
$galleryGrid: 5;
li:nth-child(#{$galleryGrid}) { margin-left: 0;}
Generates
li:nth-child(5){margin-left:0}
This markup is fine if you have absolute control over the images and layout to ensure that your elements always wrap in such a way that every 5th one begins a new row. If you cannot make such guarantees, setting negative margins on the parent element is a better way to go.

css: set image-width inside of paragraph with specific width?

hey guys,
somehow i can't find the solution for my little problem.
i have a paragraph setting with a max-width of 630px.
in some cases i have images within one of those paragraphs - and in this case i want the image to act normal -> without any max-width setting.
.post-body p {
width:99%;
max-width: 630px;
}
.post-body p img{
max-width:100% !important;
}
is it even possible to have the image larger than the max-width setting that's set to it's parent? do i need to use javascript (jquery)?
thank you for your help.
Unless you're modifying the image width some other way, as long as you don't do anything to the image it will display at full size.
See here: http://jsfiddle.net/WrfQQ/
I didn't bother declaring any CSS for the image, so it, by default, will show up at full size. (Please note, for the sake of testing I decreased the width of the p to 100px)
As I can see the problem is that you put a MAX-width to the img... you have to code the relative width... so:
.post-body p img{
position: relative;
width: 100%;
}
if you want it in jQuery the code is the below:
$('.post-body p img').width() == $('.post-body p').width();

Resources