Skip to content

Files

Latest commit

 

History

History
128 lines (105 loc) · 2.68 KB

source-emphasis.adoc

File metadata and controls

128 lines (105 loc) · 2.68 KB

Source Code Emphasis

Using Asciidoctor features

Bold markers and subs="+quotes,+macros" attribute

protected void configure(HttpSecurity http) throws Exception {
    http
        .authorizeRequests()
            .antMatchers("/resources/**").permitAll()
            .anyRequest().authenticated()
            .and()
        .formLogin()
            .loginPage("/login")
            .permitAll();

Callouts

fn main() {
    println!("Hello World!"); // (1)
}
  1. println! is a macro.

Using reveal.js <mark> tags

Needs subs="none" attribute

fn main() {
    println!("Hello marked World!");
}

Using reveal.js data-line-numbers

Highlights are using Asciidoctor syntax not reveal.js. Ex: 4..8,11 instead of 4-8,11.

import React, { useState } from 'react';

function Example() {
  const [count, setCount] = useState(0);

  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>
        Click me
      </button>
    </div>
  );
}

Step by Step with data-line-numbers

Highlights are using Asciidoctor syntax not reveal.js. Ex: 1|2..3|4,6..10 instead of 1|2-3|4,6-10.

import React, { useState } from 'react';

function Example() {
  const [count, setCount] = useState(0);

  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>
        Click me
      </button>
    </div>
  );
}

ASM from Compiler

main        proc near
var_10      = dword ptr -10h
            push ebp                      (1)
            mov ebp, esp
            and esp, 0FFFFFFF0h
            sub esp, 10h
            mov eax, offset aHelloWorld   (2)
            mov [esp+10h+var_10], eax
            call _printf
            mov eax, 0                    (3)
            leave                         (4)
            retn
main        endp
  1. Function prologue

  2. Preparing arguments and calling printf

  3. Clean-up registers

  4. Function epilogue