├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── CONTRIBUTING.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── code ├── _opts.cpp ├── _ostream.cpp ├── _sfinae_common_type.cpp ├── _switch_search.cpp ├── _switch_table.cpp ├── arithmetic.cpp ├── common_type-N3843.cpp ├── common_type-now.cpp ├── error_messages.cpp ├── indexed_sort-now.cpp ├── indexed_sort-then.cpp ├── introspection-now.cpp ├── introspection-then.cpp ├── json.cpp ├── map-now.cpp ├── map-then.cpp ├── member-should.cpp ├── member-soon.cpp ├── member-then.cpp ├── printf.cpp ├── proto.cpp ├── smallest_type.cpp ├── sorting-now.cpp ├── sorting-then.cpp ├── switch_any-now.cpp ├── switch_any-then.cpp ├── type_unification.cpp ├── unification_pros.cpp ├── unrolling-now.cpp ├── unrolling-then.cpp └── worksheet.cpp ├── css ├── custom.css ├── print │ ├── paper.css │ └── pdf.css ├── reveal.css ├── reveal.scss └── theme │ ├── README.md │ ├── beige.css │ ├── black.css │ ├── blood.css │ ├── league.css │ ├── moon.css │ ├── night.css │ ├── serif.css │ ├── simple.css │ ├── sky.css │ ├── solarized.css │ ├── source │ ├── beige.scss │ ├── black.scss │ ├── blood.scss │ ├── league.scss │ ├── moon.scss │ ├── night.scss │ ├── serif.scss │ ├── simple.scss │ ├── sky.scss │ ├── solarized.scss │ └── white.scss │ ├── template │ ├── mixins.scss │ ├── settings.scss │ └── theme.scss │ └── white.css ├── datasets ├── benchmark.including.compile.json └── benchmark.transform.compile.json ├── hana-cppnow-2015.sublime-project ├── index.html ├── index.in.html ├── js ├── chart.js └── reveal.js ├── lib ├── css │ └── zenburn.css ├── font │ ├── league-gothic │ │ ├── LICENSE │ │ ├── league-gothic.css │ │ ├── league-gothic.eot │ │ ├── league-gothic.ttf │ │ └── league-gothic.woff │ └── source-sans-pro │ │ ├── LICENSE │ │ ├── source-sans-pro-italic.eot │ │ ├── source-sans-pro-italic.ttf │ │ ├── source-sans-pro-italic.woff │ │ ├── source-sans-pro-regular.eot │ │ ├── source-sans-pro-regular.ttf │ │ ├── source-sans-pro-regular.woff │ │ ├── source-sans-pro-semibold.eot │ │ ├── source-sans-pro-semibold.ttf │ │ ├── source-sans-pro-semibold.woff │ │ ├── source-sans-pro-semibolditalic.eot │ │ ├── source-sans-pro-semibolditalic.ttf │ │ ├── source-sans-pro-semibolditalic.woff │ │ └── source-sans-pro.css └── js │ ├── classList.js │ ├── head.min.js │ └── html5shiv.js ├── package.json ├── plugin ├── highlight │ └── highlight.js ├── leap │ └── leap.js ├── markdown │ ├── example.html │ ├── example.md │ ├── markdown.js │ └── marked.js ├── math │ └── math.js ├── multiplex │ ├── client.js │ ├── index.js │ └── master.js ├── notes-server │ ├── client.js │ ├── index.js │ └── notes.html ├── notes │ ├── notes.html │ └── notes.js ├── print-pdf │ └── print-pdf.js ├── remotes │ └── remotes.js ├── search │ └── search.js └── zoom-js │ └── zoom.js ├── sampler ├── file_utils.hpp └── sampler.cpp └── test ├── examples ├── assets │ ├── image1.png │ └── image2.png ├── barebones.html ├── embedded-media.html ├── math.html └── slide-backgrounds.html ├── qunit-1.12.0.css ├── qunit-1.12.0.js ├── test-markdown-element-attributes.html ├── test-markdown-element-attributes.js ├── test-markdown-slide-attributes.html ├── test-markdown-slide-attributes.js ├── test-markdown.html ├── test-markdown.js ├── test-pdf.html ├── test-pdf.js ├── test.html └── test.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .svn 3 | log/*.log 4 | tmp/** 5 | node_modules/ 6 | .sass-cache 7 | css/reveal.min.css 8 | js/reveal.min.js 9 | /build/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.10 4 | before_script: 5 | - npm install -g grunt-cli -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Louis Dionne 2015 2 | # Distributed under the Boost Software License, Version 1.0. 3 | 4 | cmake_minimum_required(VERSION 3.0) 5 | 6 | #============================================================================= 7 | # Setup required packages 8 | #============================================================================= 9 | find_package(Boost REQUIRED) 10 | include_directories(${Boost_INCLUDE_DIRS}) 11 | 12 | include(ExternalProject) 13 | ExternalProject_Add(Hana 14 | GIT_REPOSITORY https://github.com/ldionne/hana 15 | GIT_TAG origin/develop 16 | TIMEOUT 10 17 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} 18 | PREFIX "${CMAKE_CURRENT_BINARY_DIR}" 19 | BUILD_COMMAND "" # Disable build step 20 | INSTALL_COMMAND "" # Disable install step 21 | TEST_COMMAND "" # Disable test step 22 | ) 23 | ExternalProject_Get_Property(Hana SOURCE_DIR) 24 | include_directories(${SOURCE_DIR}/include) 25 | 26 | ExternalProject_Add(Meta 27 | GIT_REPOSITORY https://github.com/ericniebler/meta 28 | GIT_TAG origin/master 29 | TIMEOUT 10 30 | CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} 31 | PREFIX "${CMAKE_CURRENT_BINARY_DIR}" 32 | BUILD_COMMAND "" # Disable build step 33 | INSTALL_COMMAND "" # Disable install step 34 | TEST_COMMAND "" # Disable test step 35 | ) 36 | ExternalProject_Get_Property(Meta SOURCE_DIR) 37 | include_directories(${SOURCE_DIR}/include) 38 | 39 | 40 | #============================================================================= 41 | # Setup compiler flags 42 | #============================================================================= 43 | include(CheckCXXCompilerFlag) 44 | macro(append_cxx_flag testname flag) 45 | check_cxx_compiler_flag(${flag} ${testname}) 46 | if (${testname}) 47 | add_compile_options(${flag}) 48 | endif() 49 | endmacro() 50 | 51 | append_cxx_flag(HAS_W_FLAG -W) 52 | append_cxx_flag(HAS_WALL_FLAG -Wall) 53 | append_cxx_flag(HAS_WEXTRA_FLAG -Wextra) 54 | append_cxx_flag(HAS_WNO_LONG_LONG_FLAG -Wno-long-long) 55 | append_cxx_flag(HAS_WNO_UNUSED_LOCAL_TYPEDEFS_FLAG -Wno-unused-local-typedefs) 56 | append_cxx_flag(HAS_WNO_UNUSED_PARAMETER_FLAG -Wno-unused-parameter) 57 | append_cxx_flag(HAS_WWRITE_STRINGS_FLAG -Wwrite-strings) 58 | append_cxx_flag(HAS_STDCXX1Y_FLAG -std=c++1y) 59 | append_cxx_flag(HAS_PEDANTIC_FLAG -pedantic) 60 | 61 | 62 | #============================================================================= 63 | # Setup the `sampler` executable 64 | #============================================================================= 65 | include_directories(sampler) 66 | add_executable(sampler sampler/sampler.cpp) 67 | 68 | 69 | #============================================================================= 70 | # Setup code samples 71 | #============================================================================= 72 | enable_testing() 73 | add_custom_target(samples) 74 | 75 | file(GLOB CODE_SAMPLES code/*.cpp) 76 | foreach(_file IN LISTS CODE_SAMPLES) 77 | file(RELATIVE_PATH _target ${CMAKE_CURRENT_SOURCE_DIR}/code ${_file}) 78 | string(REPLACE ".cpp" "" _target "${_target}") 79 | add_executable(sample.${_target} "${_file}") 80 | add_dependencies(samples sample.${_target}) 81 | add_test(sample.${_target} sample.${_target}) 82 | endforeach() 83 | 84 | 85 | #============================================================================= 86 | # Setup the index.html target 87 | #============================================================================= 88 | add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/index.html 89 | COMMAND sampler ${CMAKE_CURRENT_SOURCE_DIR}/index.in.html 90 | ${CMAKE_CURRENT_SOURCE_DIR}/index.html 91 | ${CODE_SAMPLES} 92 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/index.in.html samples sampler 93 | COMMENT "Generating index.html from index.in.html and source code samples." 94 | ) 95 | 96 | add_custom_target(index DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/index.html) 97 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. 4 | 5 | 6 | ### Personal Support 7 | If you have personal support or setup questions the best place to ask those are [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js). 8 | 9 | 10 | ### Bug Reports 11 | When reporting a bug make sure to include information about which browser and operating system you are on as well as the necessary steps to reproduce the issue. If possible please include a link to a sample presentation where the bug can be tested. 12 | 13 | 14 | ### Pull Requests 15 | - Should follow the coding style of the file you work in, most importantly: 16 | - Tabs to indent 17 | - Single-quoted strings 18 | - Should be made towards the **dev branch** 19 | - Should be submitted from a feature/topic branch (not your master) 20 | 21 | 22 | ### Plugins 23 | Please do not submit plugins as pull requests. They should be maintained in their own separate repository. More information here: https://github.com/hakimel/reveal.js/wiki/Plugin-Guidelines 24 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* global module:false */ 2 | module.exports = function(grunt) { 3 | var port = grunt.option('port') || 8000; 4 | // Project configuration 5 | grunt.initConfig({ 6 | pkg: grunt.file.readJSON('package.json'), 7 | meta: { 8 | banner: 9 | '/*!\n' + 10 | ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + 11 | ' * http://lab.hakim.se/reveal-js\n' + 12 | ' * MIT licensed\n' + 13 | ' *\n' + 14 | ' * Copyright (C) 2015 Hakim El Hattab, http://hakim.se\n' + 15 | ' */' 16 | }, 17 | 18 | qunit: { 19 | files: [ 'test/*.html' ] 20 | }, 21 | 22 | uglify: { 23 | options: { 24 | banner: '<%= meta.banner %>\n' 25 | }, 26 | build: { 27 | src: 'js/reveal.js', 28 | dest: 'js/reveal.min.js' 29 | } 30 | }, 31 | 32 | sass: { 33 | core: { 34 | files: { 35 | 'css/reveal.css': 'css/reveal.scss', 36 | } 37 | }, 38 | themes: { 39 | files: { 40 | 'css/theme/black.css': 'css/theme/source/black.scss', 41 | 'css/theme/white.css': 'css/theme/source/white.scss', 42 | 'css/theme/league.css': 'css/theme/source/league.scss', 43 | 'css/theme/beige.css': 'css/theme/source/beige.scss', 44 | 'css/theme/night.css': 'css/theme/source/night.scss', 45 | 'css/theme/serif.css': 'css/theme/source/serif.scss', 46 | 'css/theme/simple.css': 'css/theme/source/simple.scss', 47 | 'css/theme/sky.css': 'css/theme/source/sky.scss', 48 | 'css/theme/moon.css': 'css/theme/source/moon.scss', 49 | 'css/theme/solarized.css': 'css/theme/source/solarized.scss', 50 | 'css/theme/blood.css': 'css/theme/source/blood.scss' 51 | } 52 | } 53 | }, 54 | 55 | autoprefixer: { 56 | dist: { 57 | src: 'css/reveal.css' 58 | } 59 | }, 60 | 61 | cssmin: { 62 | compress: { 63 | files: { 64 | 'css/reveal.min.css': [ 'css/reveal.css' ] 65 | } 66 | } 67 | }, 68 | 69 | jshint: { 70 | options: { 71 | curly: false, 72 | eqeqeq: true, 73 | immed: true, 74 | latedef: true, 75 | newcap: true, 76 | noarg: true, 77 | sub: true, 78 | undef: true, 79 | eqnull: true, 80 | browser: true, 81 | expr: true, 82 | globals: { 83 | head: false, 84 | module: false, 85 | console: false, 86 | unescape: false, 87 | define: false, 88 | exports: false 89 | } 90 | }, 91 | files: [ 'Gruntfile.js', 'js/reveal.js' ] 92 | }, 93 | 94 | connect: { 95 | server: { 96 | options: { 97 | port: port, 98 | base: '.', 99 | livereload: true, 100 | open: true 101 | } 102 | } 103 | }, 104 | 105 | zip: { 106 | 'reveal-js-presentation.zip': [ 107 | 'index.html', 108 | 'css/**', 109 | 'js/**', 110 | 'lib/**', 111 | 'images/**', 112 | 'plugin/**' 113 | ] 114 | }, 115 | 116 | watch: { 117 | options: { 118 | livereload: true 119 | }, 120 | js: { 121 | files: [ 'Gruntfile.js', 'js/reveal.js' ], 122 | tasks: 'js' 123 | }, 124 | theme: { 125 | files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ], 126 | tasks: 'css-themes' 127 | }, 128 | css: { 129 | files: [ 'css/reveal.scss' ], 130 | tasks: 'css-core' 131 | }, 132 | html: { 133 | files: [ 'index.html'] 134 | } 135 | } 136 | 137 | }); 138 | 139 | // Dependencies 140 | grunt.loadNpmTasks( 'grunt-contrib-qunit' ); 141 | grunt.loadNpmTasks( 'grunt-contrib-jshint' ); 142 | grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); 143 | grunt.loadNpmTasks( 'grunt-contrib-uglify' ); 144 | grunt.loadNpmTasks( 'grunt-contrib-watch' ); 145 | grunt.loadNpmTasks( 'grunt-sass' ); 146 | grunt.loadNpmTasks( 'grunt-contrib-connect' ); 147 | grunt.loadNpmTasks( 'grunt-autoprefixer' ); 148 | grunt.loadNpmTasks( 'grunt-zip' ); 149 | 150 | // Default task 151 | grunt.registerTask( 'default', [ 'css', 'js' ] ); 152 | 153 | // JS task 154 | grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] ); 155 | 156 | // Theme CSS 157 | grunt.registerTask( 'css-themes', [ 'sass:themes' ] ); 158 | 159 | // Core framework CSS 160 | grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] ); 161 | 162 | // All CSS 163 | grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] ); 164 | 165 | // Package presentation to archive 166 | grunt.registerTask( 'package', [ 'default', 'zip' ] ); 167 | 168 | // Serve presentation locally 169 | grunt.registerTask( 'serve', [ 'connect', 'watch' ] ); 170 | 171 | // Run tests 172 | grunt.registerTask( 'test', [ 'jshint', 'qunit' ] ); 173 | 174 | }; 175 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015 Hakim El Hattab, http://hakim.se 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Presentation on [Hana][] for [C++Now][] 2015 2 | 3 | This repository contains my [reveal.js][]-based presentation on Hana for 4 | C++Now 2015. 5 | 6 | ## Basic usage 7 | Go to https://ldionne.github.io/cppnow-2015-hana or open `index.html` with 8 | your browser. 9 | 10 | ## Advanced usage 11 | From the root of the repository, 12 | ```sh 13 | npm install 14 | grunt serve & 15 | ``` 16 | 17 | and then connect to `localhost:8000` to view locally. 18 | 19 | ## Notes to my future self 20 | `index.html` is generated from `index.in.html`. To generate `index.html`, 21 | ```sh 22 | mkdir build 23 | cd build 24 | cmake .. 25 | make index 26 | ``` 27 | 28 | 29 | [C++Now]: http://cppnow.org 30 | [Hana]: https://github.com/ldionne/hana 31 | [reveal.js]: https://github.com/hakimel/reveal.js 32 | -------------------------------------------------------------------------------- /code/_opts.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | namespace hana = boost::hana; 7 | 8 | 9 | template 10 | constexpr auto operator"" _s() 11 | { return hana::string; } 12 | 13 | 14 | template 15 | struct option_maker { 16 | hana::_tuple options; 17 | }; 18 | 19 | 20 | 21 | template 22 | struct _option { hana::_tuple attributes; }; 23 | 24 | template 25 | auto option(Attributes ...attributes) 26 | { return _option{{attributes...}}; } 27 | 28 | 29 | template 30 | struct _banner { Description description; }; 31 | 32 | template 33 | auto banner(Description description) 34 | { return _banner{description}; } 35 | 36 | 37 | template 38 | struct _check { hana::_tuple attributes; }; 39 | 40 | template 41 | auto check(Attributes ...attributes) 42 | { return _check{{attributes...}}; } 43 | 44 | 45 | 46 | template 47 | constexpr option_maker operator|(option_maker options, Option opt) { 48 | return {{hana::append(options.options, opt)}}; 49 | } 50 | 51 | auto name = [](auto s) { return hana::make_pair("name"_s, s); }; 52 | auto description = [](auto s) { return hana::make_pair("description"_s, s); }; 53 | auto default_ = [](auto s) { return hana::make_pair("default"_s, s); }; 54 | 55 | 56 | auto options = option_maker<>{} | banner( 57 | "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod"_s 58 | ) 59 | | option(name("ignore"_s), description("Ignore incorrect values"_s)) 60 | | option(name("iters"_s), description("Number of iterations"_s), default_(5)) 61 | 62 | | option(name("volume"_s), description("Volume level"_s), default_(3.0)) 63 | | check([](auto opts) { 64 | if (opts["volume"_s] < 0) 65 | opts.die("volume must be non-negative"); 66 | }) 67 | 68 | | option(name("file"_s), description("Extra data filename to read in"_s), hana::type) 69 | | check([](auto opts) { 70 | if (opts["file"_s] && !opts["file"_s].exists()) 71 | opts.die("file must exists"); 72 | }) 73 | ; 74 | 75 | 76 | int main(int argc, char *argv[]) { 77 | // options.parse(argv, argv + argc); 78 | } 79 | -------------------------------------------------------------------------------- /code/_ostream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | using namespace boost::hana; 9 | 10 | 11 | struct concat_strings { 12 | template 13 | constexpr auto operator()(_string, _string) const 14 | { return string; } 15 | }; 16 | 17 | template 18 | constexpr auto concat_all(S s) { 19 | return fold.left(s, string<>, concat_strings{}); 20 | } 21 | 22 | 23 | 24 | constexpr auto formats = make_map( 25 | make_pair(type, string<'%', 'd'>), 26 | make_pair(type, string<'%', 'f'>), 27 | make_pair(type, string<'%', 's'>) 28 | ); 29 | 30 | constexpr struct _done { } done{}; 31 | 32 | template 33 | struct unstream_t { 34 | F f; 35 | _tuple tokens; 36 | 37 | template 38 | friend constexpr 39 | unstream_t> 40 | operator<<(unstream_t&& self, Token&& token) { 41 | return { 42 | std::move(self.f), 43 | append(std::move(self.tokens), std::forward(token)) 44 | }; 45 | } 46 | 47 | friend auto operator<<(unstream_t&& self, _done) { 48 | auto fmt = concat_all( 49 | adjust_if(self.tokens, 50 | compose(not_, is_a), 51 | [](auto&& token) { 52 | return formats[decltype_(token)]; 53 | } 54 | ) 55 | ); 56 | 57 | auto args = remove_if(std::move(self.tokens), is_a); 58 | 59 | return unpack(std::move(args), [&](auto&& ...args) { 60 | return std::move(self.f)( 61 | to(fmt), 62 | std::forward(args)... 63 | ); 64 | }); 65 | } 66 | }; 67 | 68 | template 69 | constexpr unstream_t> unstream(F&& f) { 70 | return {std::forward(f), {}}; 71 | } 72 | 73 | int main() { 74 | unstream(std::printf) 75 | << BOOST_HANA_STRING("C++Now ") 76 | << 2015 77 | << " is" 78 | << BOOST_HANA_STRING(" awesome!") 79 | << done; 80 | 81 | // equivalent to 82 | 83 | std::printf("C++Now %i%s awesome!", 2015, " is"); 84 | } 85 | -------------------------------------------------------------------------------- /code/_sfinae_common_type.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #include 12 | 13 | 14 | template 15 | using void_t = std::conditional_t; 16 | 17 | ////////////////////////////////////////////////////////////////////////////// 18 | // Eric Niebler's meta 19 | ////////////////////////////////////////////////////////////////////////////// 20 | namespace _meta { 21 | using namespace meta; 22 | 23 | // sample(sfinae_common_type-meta) 24 | template 25 | using builtin_common_t = std::decay_t() : std::declval() 27 | )>; 28 | 29 | template 30 | using lazy_builtin_common_t = defer; 31 | 32 | template 33 | struct common_type { }; 34 | 35 | template 36 | using common_type_t = eval>; 37 | 38 | template 39 | struct common_type : std::decay { }; 40 | 41 | template 42 | struct common_type 43 | : if_c<(std::is_same, T>::value && 44 | std::is_same, U>::value), 45 | lazy::let>, 46 | common_type, std::decay_t> 47 | > 48 | { }; 49 | 50 | template 51 | struct common_type 52 | : lazy::let, T, quote>> 53 | { }; 54 | // end-sample 55 | } 56 | 57 | ////////////////////////////////////////////////////////////////////////////// 58 | // Proposed implementation in n3843 (broken) 59 | ////////////////////////////////////////////////////////////////////////////// 60 | namespace n3843 { 61 | // sample(sfinae_common_type-n3843) 62 | template 63 | using builtin_common_t = decltype( 64 | true ? std::declval() : std::declval() 65 | ); 66 | 67 | template 68 | struct ct { }; 69 | 70 | template 71 | struct ct 72 | : std::decay 73 | { }; 74 | 75 | template 76 | struct ct>, T, U, V...> 77 | : ct, V...> 78 | { }; 79 | 80 | template 81 | struct common_type 82 | : ct 83 | { }; 84 | // end-sample 85 | } 86 | 87 | ////////////////////////////////////////////////////////////////////////////// 88 | // Hana 89 | ////////////////////////////////////////////////////////////////////////////// 90 | namespace _hana { 91 | using namespace boost::hana; 92 | 93 | #if 0 94 | template 95 | struct common_type 96 | : std::conditional_t, T>{} && 97 | std::is_same, U>{}, 98 | decltype(builtin_common_t(type, type)), 99 | common_type, std::decay_t> 100 | > 101 | { }; 102 | #endif 103 | 104 | // sample(sfinae_common_type-hana) 105 | auto builtin_common_t = sfinae([](auto t, auto u) -> decltype(type< 106 | std::decay_t 107 | >) { return {}; }); 108 | 109 | template 110 | struct common_type { }; 111 | 112 | template 113 | struct common_type 114 | : decltype(builtin_common_t(type, type)) 115 | { }; 116 | 117 | template 118 | struct common_type 119 | : decltype(monadic_fold(tuple_t, 120 | type>, 121 | sfinae(metafunction) 122 | )) 123 | { }; 124 | // end-sample 125 | } 126 | 127 | 128 | using _meta::common_type; 129 | // using n3843::common_type; 130 | // using _hana::common_type; 131 | 132 | template 133 | using common_type_t = typename common_type::type; 134 | 135 | 136 | ////////////////////////////////////////////////////////////////////////////// 137 | // Tests 138 | ////////////////////////////////////////////////////////////////////////////// 139 | template 140 | struct has_type : std::false_type { }; 141 | 142 | template 143 | struct has_type> : std::true_type { }; 144 | 145 | struct A { }; struct B { }; struct C { }; 146 | 147 | 148 | // Ensure proper behavior in normal cases 149 | static_assert(std::is_same< 150 | common_type_t, 151 | char 152 | >{}, ""); 153 | 154 | static_assert(std::is_same< 155 | common_type_t, 156 | A 157 | >{}, ""); 158 | 159 | static_assert(std::is_same< 160 | common_type_t, 161 | int 162 | >{}, ""); 163 | 164 | static_assert(std::is_same< 165 | common_type_t, 166 | double 167 | >{}, ""); 168 | 169 | static_assert(std::is_same< 170 | common_type_t, 171 | float 172 | >{}, ""); 173 | 174 | 175 | // Ensure SFINAE-friendliness 176 | static_assert(!has_type>{}, ""); 177 | static_assert(!has_type>{}, ""); 178 | 179 | 180 | // Ensure common_type respects user specializations 181 | template <> struct common_type { using type = C; }; 182 | template <> struct common_type { using type = C; }; 183 | template <> struct common_type { using type = C; }; 184 | template <> struct common_type { using type = C; }; 185 | template <> struct common_type { using type = C; }; 186 | template <> struct common_type { using type = C; }; 187 | static_assert(std::is_same< 188 | common_type_t, 189 | C 190 | >{}, ""); 191 | 192 | static_assert(std::is_same< 193 | common_type_t, 194 | C 195 | >{}, ""); 196 | 197 | static_assert(std::is_same< 198 | common_type_t, 199 | C 200 | >{}, ""); 201 | 202 | int main() { } 203 | -------------------------------------------------------------------------------- /code/_switch_search.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | namespace hana = boost::hana; 19 | 20 | 21 | template 22 | struct _case { 23 | template 24 | friend constexpr auto operator>>(_case, F f) { 25 | return hana::make_pair(hana::type, f); 26 | } 27 | }; 28 | 29 | template 30 | constexpr _case case_{}; 31 | 32 | struct _otherwise { }; 33 | constexpr auto otherwise = case_<_otherwise>; 34 | 35 | 36 | // Given a function `f` and a type `t`, this function returns the type of the 37 | // `f(x)` expression, where `x` is an object of type `t`. 38 | // 39 | // TODO: How to properly handle references? 40 | auto result_of = [](auto f, auto t) { 41 | return hana::type; 44 | }; 45 | 46 | auto switch_ = [](boost::any& a) { 47 | return [&a](auto&& ...cases) -> decltype(auto) { 48 | static_assert(sizeof...(cases) > 0, 49 | "invalid usage of switch without any statements"); 50 | 51 | auto parts = hana::partition( 52 | hana::make_tuple(static_cast(cases)...), 53 | [](auto&& c) { return hana::first(c) != hana::type<_otherwise>; } 54 | ); 55 | 56 | static_assert(decltype(hana::length(hana::second(parts)) == hana::size_t<1>){}, 57 | "invalid usage of switch without a default case"); 58 | auto default_ = hana::second(hana::head(hana::second(std::move(parts)))); 59 | 60 | return hana::unpack(hana::first(std::move(parts)), [&](auto&& ...cases) { 61 | auto types = hana::make_tuple(hana::first(cases)...); 62 | auto functions = hana::make_tuple( 63 | hana::second(static_cast(cases))... 64 | ); 65 | 66 | using Return = std::common_type_t< 67 | typename decltype(hana::fuse(hana::traits::common_type)( 68 | hana::zip.with(result_of, functions, types) 69 | ))::type, 70 | decltype(default_()) 71 | >; 72 | 73 | using Function = std::function; 74 | 75 | auto make_case = [](auto&& f, auto t) { 76 | using T = typename decltype(t)::type; 77 | return std::make_pair( 78 | std::type_index{typeid(T)}, 79 | [f(static_cast(f))](boost::any& a) -> Return { 80 | return f(*boost::unsafe_any_cast(&a)); 81 | } 82 | ); 83 | }; 84 | 85 | using Case = std::pair; 86 | auto table = hana::unpack(hana::zip(functions, types), [=](auto&& ...c) { 87 | return std::array{{ 88 | make_case(hana::head(c), hana::last(c))... 89 | }}; 90 | }); 91 | 92 | std::type_index const& a_index = std::type_index{a.type()}; 93 | for (int i = 0; i < static_cast(sizeof...(cases)); ++i) 94 | if (table[i].first == a_index) 95 | return table[i].second(a); 96 | 97 | return default_(); 98 | }); 99 | }; 100 | }; 101 | 102 | 103 | 104 | int main() { 105 | boost::any a = 1; 106 | switch_(a)( 107 | case_ >> [](auto& s) -> short { std::cout << s; return 1; } 108 | , case_ >> [](auto& s) -> int { std::cout << s; return 2; } 109 | , case_ >> [](auto& s) -> long { std::cout << s; return 3; } 110 | , otherwise >> []() -> long long { std::cout << "otherwise"; return 4; } 111 | ); 112 | 113 | 114 | a = "abcdef"; 115 | switch_(a)( 116 | case_ >> [](auto& s) -> std::string { std::cout << s; return s; } 117 | , case_ >> [](auto& s) -> std::string { std::cout << s; return s; } 118 | , case_ >> [](auto& s) -> std::string { std::cout << s; return s; } 119 | , otherwise >> []() -> std::string { std::cout << "otherwise"; return {}; } 120 | ); 121 | } 122 | -------------------------------------------------------------------------------- /code/_switch_table.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | namespace hana = boost::hana; 17 | 18 | #include 19 | 20 | template 21 | struct _case { 22 | template 23 | friend constexpr auto operator>>(_case, F f) { 24 | return hana::make_pair(hana::type, f); 25 | } 26 | }; 27 | 28 | template 29 | constexpr _case case_{}; 30 | 31 | 32 | struct _otherwise { 33 | template 34 | friend constexpr auto operator>>(_otherwise self, F f) { 35 | return hana::make_pair(hana::type<_otherwise>, f); 36 | } 37 | }; 38 | 39 | constexpr _otherwise otherwise{}; 40 | 41 | 42 | auto jump = [](auto ...cases) { 43 | static auto parts = hana::partition(hana::make_tuple(cases...), [](auto case_) { 44 | return hana::first(case_) != hana::type<_otherwise>; 45 | }); 46 | 47 | static_assert(!decltype(hana::is_empty(hana::second(parts))){}, 48 | "switch missing a default case"); 49 | static auto default_ = hana::head(hana::second(parts)); 50 | 51 | static auto table = hana::unpack(hana::first(parts), 52 | [=](auto ...non_defaults) { 53 | // BUG: We're deducing the result type to the wrong thing. 54 | using Return = std::common_type_t< 55 | typename decltype(hana::first(non_defaults))::type... 56 | >; 57 | using Function = std::function; 58 | 59 | auto pair = hana::fuse([](auto t, auto f) { 60 | using T = typename decltype(t)::type; 61 | return std::make_pair( 62 | std::type_index{typeid(T)}, 63 | [=](boost::any& a) -> Return { 64 | return f(*boost::any_cast(&a)); 65 | } 66 | ); 67 | }); 68 | return std::unordered_map{ 69 | pair(non_defaults)... 70 | }; 71 | }); 72 | 73 | return [](boost::any& a) -> decltype(auto) { 74 | auto it = table.find(std::type_index{a.type()}); 75 | if (it != table.end()) 76 | return it->second(a); 77 | else 78 | return hana::second(default_)(); 79 | }; 80 | }; 81 | 82 | 83 | auto switch_ = [](auto& a) { 84 | return [&a](auto ...cases) -> decltype(auto) { 85 | return jump(cases...)(a); 86 | }; 87 | }; 88 | 89 | 90 | 91 | int main() { 92 | boost::any a = std::string{"abcd"}; 93 | switch_(a)( 94 | case_ >> [](auto& s) { return s; } 95 | , case_ >> [](auto& s) -> std::string { return s; } 96 | , case_ >> [](auto& s) -> std::string { return s; } 97 | , otherwise >> []() -> std::string { return {}; } 98 | ); 99 | } 100 | -------------------------------------------------------------------------------- /code/arithmetic.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | namespace hana = boost::hana; 20 | 21 | 22 | template () 24 | >> 25 | constexpr T sqrt(T x) { 26 | T inf = 0, sup = (x == 1 ? 1 : x/2); 27 | while (!((sup - inf) <= 1 || ((sup*sup <= x) && ((sup+1)*(sup+1) > x)))) { 28 | T mid = (inf + sup) / 2; 29 | bool take_inf = mid*mid > x ? 1 : 0; 30 | inf = take_inf ? inf : mid; 31 | sup = take_inf ? mid : sup; 32 | } 33 | 34 | return sup*sup <= x ? sup : inf; 35 | } 36 | 37 | template () 39 | >> 40 | constexpr auto sqrt(T const&) { 41 | return hana::integral_constant; 42 | } 43 | 44 | 45 | namespace then { 46 | using namespace boost::mpl; 47 | 48 | template 49 | struct sqrt 50 | : integral_c 51 | { }; 52 | 53 | template 54 | struct point { 55 | using x = X; 56 | using y = Y; 57 | }; 58 | 59 | // sample(arithmetic-then) 60 | template 61 | struct distance { 62 | using xs = typename minus::type; 64 | using ys = typename minus::type; 66 | using type = typename sqrt< 67 | typename plus< 68 | typename multiplies::type, 69 | typename multiplies::type 70 | >::type 71 | >::type; 72 | }; 73 | 74 | static_assert(equal_to< 75 | distance, int_<5>>, point, int_<2>>>::type, 76 | int_<5> 77 | >::value, ""); 78 | // end-sample 79 | } 80 | 81 | 82 | namespace now { 83 | using namespace boost::hana; 84 | using namespace boost::hana::literals; 85 | 86 | template 87 | struct _point { 88 | X x; 89 | Y y; 90 | }; 91 | template 92 | constexpr _point point(X x, Y y) { return {x, y}; } 93 | 94 | // sample(arithmetic-now) 95 | template 96 | constexpr auto distance(P1 p1, P2 p2) { 97 | auto xs = p1.x - p2.x; 98 | auto ys = p1.y - p2.y; 99 | return sqrt(xs*xs + ys*ys); 100 | } 101 | 102 | static_assert(distance(point(3_c, 5_c), point(7_c, 2_c)) == 5_c, ""); 103 | // end-sample 104 | 105 | void test() { 106 | 107 | // sample(arithmetic-now-dynamic) 108 | auto p1 = point(3, 5); // dynamic values now 109 | auto p2 = point(7, 2); // 110 | assert(distance(p1, p2) == 5); // same function works! 111 | // end-sample 112 | 113 | } 114 | } 115 | 116 | 117 | int main() { 118 | now::test(); 119 | } 120 | -------------------------------------------------------------------------------- /code/common_type-N3843.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | 6 | 7 | template 8 | using void_t = std::conditional_t; 9 | 10 | 11 | // sample(common_type-N3843) 12 | template 13 | using builtin_common_t = std::decay_t() : std::declval() 15 | )>; 16 | 17 | template 18 | struct ct { }; 19 | 20 | template 21 | struct ct : std::decay { }; 22 | 23 | template 24 | struct ct>, T, U, V...> 25 | : ct, V...> 26 | { }; 27 | 28 | template 29 | struct common_type : ct { }; 30 | // end-sample 31 | 32 | template 33 | using common_type_t = typename common_type::type; 34 | 35 | 36 | ////////////////////////////////////////////////////////////////////////////// 37 | // Tests 38 | ////////////////////////////////////////////////////////////////////////////// 39 | template 40 | struct has_type : std::false_type { }; 41 | 42 | template 43 | struct has_type> : std::true_type { }; 44 | 45 | struct A { }; struct B { }; struct C { }; 46 | 47 | 48 | // Ensure proper behavior in normal cases 49 | static_assert(std::is_same< 50 | common_type_t, 51 | char 52 | >{}, ""); 53 | 54 | static_assert(std::is_same< 55 | common_type_t, 56 | A 57 | >{}, ""); 58 | 59 | static_assert(std::is_same< 60 | common_type_t, 61 | int 62 | >{}, ""); 63 | 64 | static_assert(std::is_same< 65 | common_type_t, 66 | double 67 | >{}, ""); 68 | 69 | static_assert(std::is_same< 70 | common_type_t, 71 | float 72 | >{}, ""); 73 | 74 | 75 | // Ensure SFINAE-friendliness 76 | static_assert(!has_type>{}, ""); 77 | static_assert(!has_type>{}, ""); 78 | 79 | int main() { } 80 | -------------------------------------------------------------------------------- /code/common_type-now.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | using namespace boost::hana; 11 | 12 | 13 | template 14 | using void_t = std::conditional_t; 15 | 16 | 17 | // sample(common_type-now) 18 | template 19 | auto common_type_impl = nothing; 20 | 21 | template 22 | auto common_type_impl = monadic_fold( 23 | tuple_t, type>, 24 | sfinae([](auto t, auto u) -> decltype( 25 | traits::decay(true ? traits::declval(t) : traits::declval(u)) 26 | ) { return {}; }) 27 | ); 28 | 29 | template 30 | struct common_type : decltype(common_type_impl) { }; 31 | // end-sample 32 | 33 | template 34 | using common_type_t = typename common_type::type; 35 | 36 | 37 | ////////////////////////////////////////////////////////////////////////////// 38 | // Tests 39 | ////////////////////////////////////////////////////////////////////////////// 40 | template 41 | struct has_type : std::false_type { }; 42 | 43 | template 44 | struct has_type> : std::true_type { }; 45 | 46 | struct A { }; struct B { }; struct C { }; 47 | 48 | 49 | // Ensure proper behavior in normal cases 50 | static_assert(std::is_same< 51 | common_type_t, 52 | char 53 | >{}, ""); 54 | 55 | static_assert(std::is_same< 56 | common_type_t, 57 | A 58 | >{}, ""); 59 | 60 | static_assert(std::is_same< 61 | common_type_t, 62 | int 63 | >{}, ""); 64 | 65 | static_assert(std::is_same< 66 | common_type_t, 67 | double 68 | >{}, ""); 69 | 70 | static_assert(std::is_same< 71 | common_type_t, 72 | float 73 | >{}, ""); 74 | 75 | 76 | // Ensure SFINAE-friendliness 77 | static_assert(!has_type>{}, ""); 78 | static_assert(!has_type>{}, ""); 79 | 80 | int main() { } 81 | -------------------------------------------------------------------------------- /code/error_messages.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | namespace hana = boost::hana; 8 | namespace mpl = boost::mpl; 9 | 10 | 11 | #if 0 12 | // sample(error_messages-then) 13 | using xs = mpl::reverse>::type; 14 | // end-sample 15 | #endif 16 | 17 | #if 0 18 | // sample(error_messages-now) 19 | auto xs = hana::reverse(1); 20 | // end-sample 21 | #endif 22 | 23 | 24 | int main() { } 25 | -------------------------------------------------------------------------------- /code/indexed_sort-now.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | 6 | #include 7 | using namespace boost::hana; 8 | using namespace boost::hana::literals; 9 | 10 | 11 | // sample(indexed_sort-now-impl) 12 | auto indexed_sort = [](auto list, auto predicate) { 13 | auto indices = to(range(0_c, size(list))); 14 | auto indexed_list = zip.with(make_pair, list, indices); 15 | auto sorted = sort(indexed_list, [&](auto const& x, auto const& y) { 16 | return predicate(first(x), first(y)); 17 | }); 18 | return make_pair(transform(sorted, first), transform(sorted, second)); 19 | }; 20 | // end-sample 21 | 22 | 23 | int main() { 24 | // sample(indexed_sort-now-usage1) 25 | auto types = tuple_t; 26 | auto indexed = indexed_sort(types, [](auto t, auto u) { 27 | return sizeof_(t) < sizeof_(u); 28 | }); 29 | 30 | auto sorted = first(indexed); 31 | auto indices = second(indexed); 32 | 33 | static_assert(sorted == tuple_t, ""); 34 | static_assert(indices == tuple_c, ""); 35 | // end-sample 36 | 37 | // sample(indexed_sort-now-usage2) 38 | using Sequence = decltype(unpack(sorted, template_<_tuple>))::type; 39 | auto index_map = second(indexed_sort(indices, less)); 40 | 41 | Sequence s; 42 | int (&a)[3] = s[index_map[0_c]]; 43 | int (&b)[2] = s[index_map[1_c]]; 44 | int (&c)[1] = s[index_map[2_c]]; 45 | // end-sample 46 | 47 | (void)a; 48 | (void)b; 49 | (void)c; 50 | } 51 | -------------------------------------------------------------------------------- /code/indexed_sort-then.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | namespace fusion = boost::fusion; 24 | using namespace boost::mpl; 25 | 26 | 27 | // sample(indexed_sort-then-impl) 28 | template > 29 | struct indexed_sort { 30 | using indexed_types = typename copy< 31 | zip_view::value>>>, 32 | back_inserter> 33 | >::type; 34 | 35 | using sorted = typename sort< 36 | indexed_types, 37 | apply2::type, front<_1>, front<_2>> 38 | >::type; 39 | 40 | using type = pair< 41 | typename transform>::type, 42 | typename transform>::type 43 | >; 44 | }; 45 | // end-sample 46 | 47 | int main() { 48 | // sample(indexed_sort-then-usage1) 49 | using Types = vector; 50 | using Indexed = indexed_sort, 51 | sizeof_<_2>>>::type; 52 | 53 | using Sorted = Indexed::first; 54 | using Indices = Indexed::second; 55 | 56 | static_assert(equal>::value, ""); 57 | 58 | static_assert(equal, 59 | // mpl::equal does a shallow comparison without this 60 | quote2 61 | >::value, ""); 62 | // end-sample 63 | 64 | // sample(indexed_sort-then-usage2) 65 | using Sequence = fusion::result_of::as_vector::type; 66 | using IndexMap = indexed_sort::type::second; 67 | 68 | Sequence s; 69 | int (&a)[3] = fusion::at_c::type::value>(s); 70 | int (&b)[2] = fusion::at_c::type::value>(s); 71 | int (&c)[1] = fusion::at_c::type::value>(s); 72 | // end-sample 73 | 74 | (void)a; 75 | (void)b; 76 | (void)c; 77 | } 78 | -------------------------------------------------------------------------------- /code/introspection-now.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | using namespace boost::hana; 12 | 13 | 14 | // sample(introspection-now) 15 | struct Person { 16 | BOOST_HANA_DEFINE_STRUCT(Person, 17 | (std::string, name), 18 | (int, age) 19 | ); 20 | }; 21 | 22 | int main() { 23 | Person john{"John", 30}; 24 | std::string name = at_key(john, BOOST_HANA_STRING("name")); 25 | int age = at_key(john, BOOST_HANA_STRING("age")); 26 | } 27 | // end-sample 28 | -------------------------------------------------------------------------------- /code/introspection-then.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | using namespace boost::fusion; 9 | 10 | 11 | // sample(introspection-then) 12 | namespace keys { 13 | struct name; 14 | struct age; 15 | } 16 | 17 | BOOST_FUSION_DEFINE_ASSOC_STRUCT( 18 | /* global scope */, Person, 19 | (std::string, name, keys::name) 20 | (int, age, keys::age) 21 | ) 22 | 23 | int main() { 24 | Person john{"John", 30}; 25 | std::string name = at_key(john); 26 | int age = at_key(john); 27 | } 28 | // end-sample 29 | -------------------------------------------------------------------------------- /code/json.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | using namespace boost::hana; 12 | using namespace std::literals; 13 | 14 | 15 | 16 | 17 | template 18 | std::string join(Xs&& xs, std::string sep) { 19 | return fold.left(intersperse(std::forward(xs), sep), "", _ + _); 20 | } 21 | 22 | // sample(json-base) 23 | std::string quote(std::string s) { return "\"" + s + "\""; } 24 | 25 | template 26 | auto to_json(T const& x) -> decltype(std::to_string(x)) { 27 | return std::to_string(x); 28 | } 29 | 30 | std::string to_json(char c) { return quote({c}); } 31 | std::string to_json(std::string s) { return quote(s); } 32 | // end-sample 33 | 34 | // sample(json-Struct) 35 | template 36 | std::enable_if_t(), 37 | std::string> to_json(T const& x) { 38 | auto json = transform(keys(x), [&](auto name) { 39 | auto const& member = at_key(x, name); 40 | return quote(to(name)) + " : " + to_json(member); 41 | }); 42 | 43 | return "{" + join(std::move(json), ", ") + "}"; 44 | } 45 | // end-sample 46 | 47 | // sample(json-Sequence) 48 | template 49 | std::enable_if_t(), 50 | std::string> to_json(Xs const& xs) { 51 | auto json = transform(xs, [](auto const& x) { 52 | return to_json(x); 53 | }); 54 | 55 | return "[" + join(std::move(json), ", ") + "]"; 56 | } 57 | // end-sample 58 | 59 | 60 | int main() { 61 | // sample(json-usage) 62 | struct Person { 63 | BOOST_HANA_DEFINE_STRUCT(Person, 64 | (std::string, name), 65 | (int, age) 66 | ); 67 | }; 68 | 69 | Person joe{"Joe", 30}; 70 | std::cout << to_json(make_tuple(1, 'c', joe)); 71 | // end-sample 72 | } 73 | -------------------------------------------------------------------------------- /code/map-now.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | using namespace boost::hana; 10 | 11 | 12 | int main() { 13 | // sample(map-now) 14 | auto map = make_map( 15 | make_pair(type, "char"), 16 | make_pair(type, "int"), 17 | make_pair(type, "long"), 18 | make_pair(type, "float"), 19 | make_pair(type, "double") 20 | ); 21 | 22 | std::string i = map[type]; 23 | assert(i == "int"); 24 | // end-sample 25 | } 26 | -------------------------------------------------------------------------------- /code/map-then.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | using namespace boost::fusion; 10 | 11 | 12 | int main() { 13 | // sample(map-then) 14 | auto map = make_map( 15 | "char", "int", "long", "float", "double", "void" 16 | ); 17 | 18 | std::string i = at_key(map); 19 | assert(i == "int"); 20 | // end-sample 21 | } 22 | -------------------------------------------------------------------------------- /code/member-should.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | using namespace boost::hana; 6 | 7 | 8 | int main() { 9 | // sample(member-should) 10 | auto has_xxx = is_valid([](auto t) -> decltype(t.xxx) {}); 11 | 12 | struct Foo { int xxx; }; 13 | Foo foo{1}; 14 | 15 | static_assert(has_xxx(foo), ""); 16 | static_assert(!has_xxx("abcdef"), ""); 17 | // end-sample 18 | } 19 | -------------------------------------------------------------------------------- /code/member-soon.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | 6 | 7 | namespace std { 8 | template 9 | using void_t = void; 10 | } 11 | 12 | // sample(member-soon) 13 | template 14 | struct has_xxx 15 | : std::false_type 16 | { }; 17 | 18 | template 19 | struct has_xxx> 20 | : std::true_type 21 | { }; 22 | 23 | struct Foo { int xxx; }; 24 | static_assert(has_xxx::value, ""); 25 | // end-sample 26 | 27 | int main() { } 28 | -------------------------------------------------------------------------------- /code/member-then.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | 6 | 7 | // sample(member-then) 8 | template 9 | static std::true_type has_xxx_impl(int); 10 | 11 | template 12 | static std::false_type has_xxx_impl(...); 13 | 14 | template 15 | struct has_xxx 16 | : decltype(has_xxx_impl(int{})) 17 | { }; 18 | 19 | struct Foo { int xxx; }; 20 | static_assert(has_xxx::value, ""); 21 | // end-sample 22 | 23 | int main() { } 24 | -------------------------------------------------------------------------------- /code/printf.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | using namespace boost::hana; 9 | using namespace boost::hana::literals; 10 | 11 | 12 | // sample(printf-formats) 13 | auto formats = make_map( 14 | make_pair(char_<'i'>, type), 15 | make_pair(char_<'f'>, type), 16 | make_pair(char_<'s'>, type) 17 | 18 | // ... 19 | ); 20 | // end-sample 21 | 22 | // sample(printf-core) 23 | template 24 | int type_safe_printf(Fmt fmt, Args const& ...args) { 25 | static_assert(is_a(fmt), 26 | "the format string must be a compile-time hana::String"); 27 | 28 | auto format_chars = filter(to(fmt), [](auto c) { 29 | return contains(formats, c); 30 | }); 31 | 32 | static_assert(length(format_chars) == sizeof...(args), 33 | "number of arguments not matching the number of format characters"); 34 | 35 | auto conversions = zip(tuple_t...>, format_chars); 36 | for_each(conversions, fuse([](auto arg_type, auto format_char) { 37 | static_assert(decltype(formats[format_char] == arg_type){}, 38 | "the type of the argument does not match the format character"); 39 | })); 40 | 41 | return std::printf(to(fmt), args...); 42 | }; 43 | // end-sample 44 | 45 | int main() { 46 | 47 | #if 1 48 | // sample(printf-usage) 49 | type_safe_printf(BOOST_HANA_STRING("%i, %f, %s"), 2, 3.4, "abcd"); 50 | // end-sample 51 | #elif 0 52 | // sample(printf-wrong_type) 53 | type_safe_printf(BOOST_HANA_STRING("%i, %f, %s"), 2, 2, "abcd"); 54 | // end-sample 55 | #elif 0 56 | // sample(printf-wrong_narg) 57 | type_safe_printf(BOOST_HANA_STRING("%i, %f, %s"), 2, 3.4); 58 | // end-sample 59 | #endif 60 | 61 | } 62 | -------------------------------------------------------------------------------- /code/proto.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // 4 | // This is an adapted version of the "Calc1" example in Proto's documentation 5 | // to work with compile-time integers too. 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | namespace proto = boost::proto; 14 | namespace hana = boost::hana; 15 | using namespace hana::literals; 16 | 17 | 18 | template 19 | struct placeholder { }; 20 | 21 | // Define some placeholders 22 | proto::terminal>::type const _1 = {{}}; 23 | proto::terminal>::type const _2 = {{}}; 24 | 25 | // Define a calculator context, for evaluating arithmetic expressions 26 | template 27 | struct calculator_context 28 | : proto::callable_context const> 29 | { 30 | // The values bound to the placeholders 31 | M m; 32 | N n; 33 | 34 | constexpr calculator_context(M m, N n) : m{m}, n{n} { } 35 | 36 | // The result of evaluating arithmetic expressions 37 | template 38 | struct result; 39 | 40 | template 41 | struct result const&)> { 42 | using type = M; 43 | }; 44 | 45 | template 46 | struct result const&)> { 47 | using type = N; 48 | }; 49 | 50 | // Handle the evaluation of the placeholder terminals 51 | constexpr auto operator()(proto::tag::terminal, placeholder<1>) const 52 | { return m; } 53 | 54 | constexpr auto operator()(proto::tag::terminal, placeholder<2>) const 55 | { return n; } 56 | }; 57 | 58 | template 59 | constexpr auto evaluate(Expr expr, M m, N n) { 60 | // Create a calculator context with d1 and d2 substituted for _1 and _2 61 | calculator_context const ctx{m, n}; 62 | 63 | // Evaluate the calculator expression with the calculator_context 64 | return proto::eval(expr, ctx); 65 | } 66 | 67 | int main() { 68 | // sample(proto) 69 | auto expr = (_1 - _2) / _2; 70 | 71 | // compile-time computations 72 | static_assert(decltype(evaluate(expr, 6_c, 2_c))::value == 2, ""); 73 | 74 | // runtime computations 75 | int i = 6, j = 2; 76 | assert(evaluate(expr, i, j) == 2); 77 | // end-sample 78 | } 79 | -------------------------------------------------------------------------------- /code/smallest_type.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | 16 | template 17 | struct storage { char weight[n]; }; 18 | 19 | namespace then { 20 | using namespace boost::mpl; 21 | 22 | // sample(smallest_type-then) 23 | template 24 | struct smallest 25 | : deref< 26 | typename min_element< 27 | vector, less, sizeof_<_2>> 28 | >::type 29 | > 30 | { }; 31 | 32 | template 33 | using smallest_t = typename smallest::type; 34 | 35 | static_assert(std::is_same< 36 | smallest_t, char 37 | >::value, ""); 38 | // end-sample 39 | 40 | static_assert(std::is_same< 41 | smallest_t, storage<1>, storage<2>>, 42 | storage<1> 43 | >::value, ""); 44 | } 45 | 46 | 47 | namespace now { 48 | using namespace boost::hana; 49 | 50 | // sample(smallest_type-now) 51 | template 52 | auto smallest = minimum(tuple_t, [](auto t, auto u) { 53 | return sizeof_(t) < sizeof_(u); 54 | }); 55 | 56 | template 57 | using smallest_t = typename decltype(smallest)::type; 58 | 59 | static_assert(std::is_same< 60 | smallest_t, char 61 | >::value, ""); 62 | // end-sample 63 | 64 | static_assert(std::is_same< 65 | smallest_t, storage<1>, storage<2>>, 66 | storage<1> 67 | >::value, ""); 68 | } 69 | 70 | int main() { } 71 | -------------------------------------------------------------------------------- /code/sorting-now.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | using namespace boost::hana; 11 | 12 | 13 | namespace disambiguate { 14 | // sample(sorting-now) 15 | template 16 | auto sort(Xs xs, Pred pred) { 17 | return eval_if(length(xs) < size_t<2>, 18 | lazy(xs), 19 | lazy([=](auto xs) { 20 | auto pivot = head(xs); 21 | auto parts = partition(tail(xs), partial(pred, pivot)); 22 | return concat( 23 | append(sort(second(parts), pred), pivot), 24 | sort(first(parts), pivot) 25 | ); 26 | })(xs) 27 | ); 28 | } 29 | // end-sample 30 | } 31 | 32 | int main() { 33 | using disambiguate::sort; 34 | BOOST_HANA_CONSTANT_CHECK( 35 | sort(make_tuple(), less) == make_tuple() 36 | ); 37 | 38 | BOOST_HANA_CONSTANT_CHECK( 39 | sort(make_tuple(int_<1>), less) == make_tuple(int_<1>) 40 | ); 41 | 42 | BOOST_HANA_CONSTANT_CHECK( 43 | sort(make_tuple(int_<2>, int_<1>), less) == make_tuple(int_<1>, int_<2>) 44 | ); 45 | 46 | BOOST_HANA_CONSTANT_CHECK( 47 | sort(make_tuple(int_<3>, int_<2>, int_<1>), less) == 48 | make_tuple(int_<1>, int_<2>, int_<3>) 49 | ); 50 | 51 | BOOST_HANA_CONSTANT_CHECK( 52 | sort(make_tuple(int_<4>, int_<3>, int_<2>, int_<1>), less) == 53 | make_tuple(int_<1>, int_<2>, int_<3>, int_<4>) 54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /code/sorting-then.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | using namespace boost::mpl; 25 | 26 | 27 | // sample(sorting-then1) 28 | template 29 | struct sort_impl; 30 | 31 | template 32 | struct sort 33 | : eval_if, 34 | identity, 35 | sort_impl 36 | > 37 | { }; 38 | // end-sample 39 | 40 | // sample(sorting-then2) 41 | template 42 | struct sort_impl { 43 | using pivot = typename begin::type; 44 | using parts = typename partition< 45 | iterator_range::type, 46 | typename end::type> 47 | , apply2::type, _1, 48 | typename deref::type> 49 | , back_inserter> 50 | , back_inserter> 51 | >::type; 52 | 53 | using part1 = typename push_back< 54 | typename sort::type, 55 | typename deref::type 56 | >::type; 57 | 58 | using part2 = typename sort::type; 59 | 60 | using type = typename insert_range< 61 | part1, typename end::type, part2 62 | >::type; 63 | }; 64 | // end-sample 65 | 66 | static_assert(equal< 67 | sort, quote2>::type, 68 | vector<> 69 | >::value, ""); 70 | 71 | static_assert(equal< 72 | sort>, quote2>::type, 73 | vector> 74 | >::value, ""); 75 | 76 | static_assert(equal< 77 | sort, int_<1>>, quote2>::type, 78 | vector, int_<2>> 79 | >::value, ""); 80 | 81 | static_assert(equal< 82 | sort, int_<2>, int_<1>>, quote2>::type, 83 | vector, int_<2>, int_<3>> 84 | >::value, ""); 85 | 86 | static_assert(equal< 87 | sort, int_<3>, int_<2>, int_<1>>, quote2>::type, 88 | vector, int_<2>, int_<3>, int_<4>> 89 | >::value, ""); 90 | 91 | 92 | int main() { } 93 | -------------------------------------------------------------------------------- /code/switch_any-now.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | namespace hana = boost::hana; 16 | 17 | 18 | // sample(switch_any-now-impl1) 19 | template 20 | auto case_ = [](auto f) { 21 | return std::make_pair(hana::type, f); 22 | }; 23 | 24 | struct _default; 25 | auto default_ = case_<_default>; 26 | auto empty = case_; 27 | // end-sample 28 | 29 | 30 | // sample(switch_any-now-impl4) 31 | template 32 | Result impl(Any&, std::type_index const& t, Default& default_) { 33 | return default_(); 34 | } 35 | // end-sample 36 | 37 | // sample(switch_any-now-impl3) 38 | template 40 | Result impl(Any& a, std::type_index const& t, Default& default_, 41 | Case& case_, Rest& ...rest) 42 | { 43 | using T = typename decltype(case_.first)::type; 44 | if (t == typeid(T)) { 45 | return hana::if_(hana::type == hana::type, 46 | [](auto& case_, auto& a) { 47 | return case_.second(); 48 | }, 49 | [](auto& case_, auto& a) { 50 | return case_.second(*boost::unsafe_any_cast(&a)); 51 | } 52 | )(case_, a); 53 | } 54 | else 55 | return impl(a, t, default_, rest...); 56 | } 57 | // end-sample 58 | 59 | // sample(switch_any-now-impl2) 60 | template 61 | auto switch_(Any& a) { 62 | return [&a](auto ...cases_) -> Result { 63 | auto cases = hana::make_tuple(cases_...); 64 | 65 | auto default_ = hana::find_if(cases, [](auto const& c) { 66 | return c.first == hana::type<_default>; 67 | }); 68 | static_assert(!hana::is_nothing(default_), 69 | "switch is missing a default_ case"); 70 | 71 | auto rest = hana::filter(cases, [](auto const& c) { 72 | return c.first != hana::type<_default>; 73 | }); 74 | 75 | return hana::unpack(rest, [&](auto& ...rest) { 76 | return impl(a, a.type(), default_->second, rest...); 77 | }); 78 | }; 79 | } 80 | // end-sample 81 | 82 | 83 | static std::vector> tests{ 84 | [] { 85 | boost::any a; 86 | int result = switch_(a)( 87 | default_([] { return 1; }) 88 | ); 89 | assert(result == 1); 90 | } 91 | 92 | , [] { 93 | boost::any a; 94 | int result = switch_(a)( 95 | empty([] { return 2; }), 96 | default_([] { return 1; }) 97 | ); 98 | assert(result == 2); 99 | } 100 | 101 | , [] { 102 | boost::any a = 1; 103 | int result = switch_(a)( 104 | empty([] { return 2; }), 105 | default_([] { return 1; }) 106 | ); 107 | assert(result == 1); 108 | } 109 | 110 | , [] { 111 | boost::any a = 3; 112 | int result = switch_(a)( 113 | case_([](int& i) { return i; }), 114 | empty([] { return 2; }), 115 | default_([] { return 1; }) 116 | ); 117 | assert(result == 3); 118 | } 119 | 120 | , [] { 121 | boost::any a = 3; 122 | const boost::any& ra = a; 123 | int result = switch_(ra)( 124 | case_([](const int& i) { return i; }), 125 | empty([] { return 2; }), 126 | default_([] { return 1; }) 127 | ); 128 | assert(result == 3); 129 | } 130 | 131 | , [] { 132 | boost::any a = 3; 133 | int result = switch_(a)( 134 | empty([] { return 2; }), 135 | default_([] { return 1; }), 136 | case_([](const int& i) { return i; }) 137 | ); 138 | assert(result == 3); 139 | } 140 | 141 | // This test case is disabled because I consider it a flaw that 142 | // default_ is not mandatory. 143 | #if 0 144 | , [] { 145 | boost::any a = 3.0; 146 | int result = 1; 147 | switch_(a, 148 | case_([&](const int& i) { result = i; }), 149 | empty([&] { result = 2; }) 150 | ); 151 | assert(result == 1); 152 | } 153 | #endif 154 | 155 | // implicit case_ and default_ are not supported for simplicity 156 | #if 0 157 | , [] { 158 | boost::any a = 3; 159 | int result = switch_(a, 160 | case_([](int& i) { return i; }), 161 | empty([] { return 2; }), 162 | default_([] { return 1; }) 163 | ); 164 | assert(result == 3); 165 | } 166 | 167 | , [] { 168 | boost::any a; 169 | int result = switch_(a, 170 | [] { return 2; }, 171 | default_([] { return 1; }) 172 | ); 173 | assert(result == 2); 174 | } 175 | 176 | , [] { 177 | boost::any a = 3; 178 | int result = switch_(a, 179 | [] { return 2; }, 180 | default_([] { return 1; }), 181 | [](int& i) { return i; } 182 | ); 183 | assert(result == 3); 184 | } 185 | #endif 186 | }; 187 | 188 | int main() { 189 | for (auto& test: tests) 190 | test(); 191 | 192 | // sample(switch_any-now-usage) 193 | boost::any a = 3; 194 | std::string result = switch_(a)( 195 | case_([](int i) { return std::to_string(i); }) 196 | , case_([](double d) { return std::to_string(d); }) 197 | , empty([] { return "empty"; }) 198 | , default_([] { return "default"; }) 199 | ); 200 | assert(result == "3"); 201 | // end-sample 202 | } 203 | -------------------------------------------------------------------------------- /code/type_unification.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | // sample(type_unification-Type) 11 | template 12 | class Type { /* nothing */ }; 13 | 14 | Type t{}; 15 | // end-sample 16 | 17 | // sample(type_unification-metafunction) 18 | template 19 | constexpr Type add_pointer(Type const&) 20 | { return {}; } 21 | 22 | template 23 | constexpr std::false_type is_pointer(Type const&) 24 | { return {}; } 25 | 26 | template 27 | constexpr std::true_type is_pointer(Type const&) 28 | { return {}; } 29 | // end-sample 30 | 31 | namespace usage { 32 | // sample(type_unification-usage) 33 | Type t{}; 34 | auto p = add_pointer(t); 35 | static_assert(is_pointer(p), ""); 36 | // end-sample 37 | } 38 | 39 | namespace sugar { 40 | // sample(type_unification-sugar) 41 | template 42 | constexpr Type type{}; 43 | 44 | auto t = type; 45 | auto p = add_pointer(t); 46 | static_assert(is_pointer(p), ""); 47 | // end-sample 48 | } 49 | 50 | namespace citizen { 51 | using namespace boost::hana; 52 | using namespace boost::hana::literals; 53 | 54 | // sample(type_unification-first_class) 55 | auto xs = make_tuple(type, type, type); 56 | auto c = xs[1_c]; 57 | 58 | // sugar: 59 | auto ys = tuple_t; 60 | // end-sample 61 | } 62 | 63 | int main() { } 64 | -------------------------------------------------------------------------------- /code/unification_pros.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | namespace fusion = boost::fusion; 19 | namespace mpl = boost::mpl; 20 | 21 | 22 | int main() { 23 | 24 | { 25 | 26 | using namespace boost::mpl; 27 | 28 | // sample(full_language-then) 29 | using ts = vector; 30 | using us = copy_if, 31 | std::is_reference<_1>>>::type; 32 | // end-sample 33 | 34 | static_assert(equal>::value, ""); 35 | 36 | }{ 37 | 38 | using namespace boost::hana; 39 | using namespace boost::hana::traits; 40 | 41 | // sample(full_language-now) 42 | auto ts = make_tuple(type, type, type); 43 | auto us = filter(ts, [](auto t) { 44 | return or_(is_pointer(t), is_reference(t)); 45 | }); 46 | // end-sample 47 | 48 | BOOST_HANA_CONSTANT_CHECK(us == make_tuple(type, type)); 49 | 50 | }{ 51 | 52 | using mpl::_1; 53 | 54 | // sample(onelib-then) 55 | // types (MPL) 56 | using ts = mpl::vector; 57 | using us = mpl::copy_if, 58 | std::is_reference<_1>>>::type; 59 | 60 | // values (Fusion) 61 | auto vs = fusion::make_vector(1, 'c', nullptr, 3.5); 62 | auto ws = fusion::filter_if>(vs); 63 | // end-sample 64 | 65 | static_assert(mpl::equal>::value, ""); 66 | BOOST_HANA_RUNTIME_CHECK(ws == fusion::make_vector(1, 'c')); 67 | 68 | }{ 69 | 70 | using namespace boost::hana; 71 | using namespace boost::hana::traits; 72 | 73 | // sample(onelib-now) 74 | // types 75 | auto ts = tuple_t; 76 | auto us = filter(ts, [](auto t) { 77 | return or_(is_pointer(t), is_reference(t)); 78 | }); 79 | 80 | // values 81 | auto vs = make_tuple(1, 'c', nullptr, 3.5); 82 | auto ws = filter(vs, [](auto t) { 83 | return is_integral(t); 84 | }); 85 | // end-sample 86 | 87 | BOOST_HANA_CONSTANT_CHECK(us == make_tuple(type, type)); 88 | BOOST_HANA_RUNTIME_CHECK(ws == make_tuple(1, 'c')); 89 | 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /code/unrolling-now.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | #include 5 | using namespace boost::hana; 6 | 7 | 8 | // sample(unrolling-now) 9 | __attribute__((noinline)) void f() { } 10 | 11 | int main() { 12 | int_<10>.times(f); 13 | } 14 | // end-sample 15 | -------------------------------------------------------------------------------- /code/unrolling-then.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | // sample(unrolling-then) 5 | __attribute__((noinline)) void f() { } 6 | 7 | int main() { 8 | #pragma PLZ UNROLL 9 | for (int i = 0; i != 10; ++i) 10 | f(); 11 | } 12 | // end-sample 13 | -------------------------------------------------------------------------------- /code/worksheet.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Louis Dionne 2015 2 | // Distributed under the Boost Software License, Version 1.0. 3 | 4 | 5 | int main() { } 6 | -------------------------------------------------------------------------------- /css/custom.css: -------------------------------------------------------------------------------- 1 | /* Make sure code appearing in headers is not capitalized */ 2 | .reveal h1 code, .reveal h2 code, .reveal h3 code, .reveal h4 code { 3 | text-transform: none; 4 | } 5 | 6 | /* Allow code boxes to be longer */ 7 | .reveal pre code { 8 | max-height: 550px; 9 | } 10 | -------------------------------------------------------------------------------- /css/print/paper.css: -------------------------------------------------------------------------------- 1 | /* Default Print Stylesheet Template 2 | by Rob Glazebrook of CSSnewbie.com 3 | Last Updated: June 4, 2008 4 | 5 | Feel free (nay, compelled) to edit, append, and 6 | manipulate this file as you see fit. */ 7 | 8 | 9 | @media print { 10 | 11 | /* SECTION 1: Set default width, margin, float, and 12 | background. This prevents elements from extending 13 | beyond the edge of the printed page, and prevents 14 | unnecessary background images from printing */ 15 | html { 16 | background: #fff; 17 | width: auto; 18 | height: auto; 19 | overflow: visible; 20 | } 21 | body { 22 | background: #fff; 23 | font-size: 20pt; 24 | width: auto; 25 | height: auto; 26 | border: 0; 27 | margin: 0 5%; 28 | padding: 0; 29 | overflow: visible; 30 | float: none !important; 31 | } 32 | 33 | /* SECTION 2: Remove any elements not needed in print. 34 | This would include navigation, ads, sidebars, etc. */ 35 | .nestedarrow, 36 | .controls, 37 | .fork-reveal, 38 | .share-reveal, 39 | .state-background, 40 | .reveal .progress, 41 | .reveal .backgrounds { 42 | display: none !important; 43 | } 44 | 45 | /* SECTION 3: Set body font face, size, and color. 46 | Consider using a serif font for readability. */ 47 | body, p, td, li, div { 48 | font-size: 20pt!important; 49 | font-family: Georgia, "Times New Roman", Times, serif !important; 50 | color: #000; 51 | } 52 | 53 | /* SECTION 4: Set heading font face, sizes, and color. 54 | Differentiate your headings from your body text. 55 | Perhaps use a large sans-serif for distinction. */ 56 | h1,h2,h3,h4,h5,h6 { 57 | color: #000!important; 58 | height: auto; 59 | line-height: normal; 60 | font-family: Georgia, "Times New Roman", Times, serif !important; 61 | text-shadow: 0 0 0 #000 !important; 62 | text-align: left; 63 | letter-spacing: normal; 64 | } 65 | /* Need to reduce the size of the fonts for printing */ 66 | h1 { font-size: 28pt !important; } 67 | h2 { font-size: 24pt !important; } 68 | h3 { font-size: 22pt !important; } 69 | h4 { font-size: 22pt !important; font-variant: small-caps; } 70 | h5 { font-size: 21pt !important; } 71 | h6 { font-size: 20pt !important; font-style: italic; } 72 | 73 | /* SECTION 5: Make hyperlinks more usable. 74 | Ensure links are underlined, and consider appending 75 | the URL to the end of the link for usability. */ 76 | a:link, 77 | a:visited { 78 | color: #000 !important; 79 | font-weight: bold; 80 | text-decoration: underline; 81 | } 82 | /* 83 | .reveal a:link:after, 84 | .reveal a:visited:after { 85 | content: " (" attr(href) ") "; 86 | color: #222 !important; 87 | font-size: 90%; 88 | } 89 | */ 90 | 91 | 92 | /* SECTION 6: more reveal.js specific additions by @skypanther */ 93 | ul, ol, div, p { 94 | visibility: visible; 95 | position: static; 96 | width: auto; 97 | height: auto; 98 | display: block; 99 | overflow: visible; 100 | margin: 0; 101 | text-align: left !important; 102 | } 103 | .reveal pre, 104 | .reveal table { 105 | margin-left: 0; 106 | margin-right: 0; 107 | } 108 | .reveal pre code { 109 | padding: 20px; 110 | border: 1px solid #ddd; 111 | } 112 | .reveal blockquote { 113 | margin: 20px 0; 114 | } 115 | .reveal .slides { 116 | position: static !important; 117 | width: auto !important; 118 | height: auto !important; 119 | 120 | left: 0 !important; 121 | top: 0 !important; 122 | margin-left: 0 !important; 123 | margin-top: 0 !important; 124 | padding: 0 !important; 125 | zoom: 1 !important; 126 | 127 | overflow: visible !important; 128 | display: block !important; 129 | 130 | text-align: left !important; 131 | -webkit-perspective: none; 132 | -moz-perspective: none; 133 | -ms-perspective: none; 134 | perspective: none; 135 | 136 | -webkit-perspective-origin: 50% 50%; 137 | -moz-perspective-origin: 50% 50%; 138 | -ms-perspective-origin: 50% 50%; 139 | perspective-origin: 50% 50%; 140 | } 141 | .reveal .slides section { 142 | visibility: visible !important; 143 | position: static !important; 144 | width: 100% !important; 145 | height: auto !important; 146 | display: block !important; 147 | overflow: visible !important; 148 | 149 | left: 0 !important; 150 | top: 0 !important; 151 | margin-left: 0 !important; 152 | margin-top: 0 !important; 153 | padding: 60px 20px !important; 154 | z-index: auto !important; 155 | 156 | opacity: 1 !important; 157 | 158 | page-break-after: always !important; 159 | 160 | -webkit-transform-style: flat !important; 161 | -moz-transform-style: flat !important; 162 | -ms-transform-style: flat !important; 163 | transform-style: flat !important; 164 | 165 | -webkit-transform: none !important; 166 | -moz-transform: none !important; 167 | -ms-transform: none !important; 168 | transform: none !important; 169 | 170 | -webkit-transition: none !important; 171 | -moz-transition: none !important; 172 | -ms-transition: none !important; 173 | transition: none !important; 174 | } 175 | .reveal .slides section.stack { 176 | padding: 0 !important; 177 | } 178 | .reveal section:last-of-type { 179 | page-break-after: avoid !important; 180 | } 181 | .reveal section .fragment { 182 | opacity: 1 !important; 183 | visibility: visible !important; 184 | 185 | -webkit-transform: none !important; 186 | -moz-transform: none !important; 187 | -ms-transform: none !important; 188 | transform: none !important; 189 | } 190 | .reveal section img { 191 | display: block; 192 | margin: 15px 0px; 193 | background: rgba(255,255,255,1); 194 | border: 1px solid #666; 195 | box-shadow: none; 196 | } 197 | 198 | .reveal section small { 199 | font-size: 0.8em; 200 | } 201 | 202 | } -------------------------------------------------------------------------------- /css/print/pdf.css: -------------------------------------------------------------------------------- 1 | /* Default Print Stylesheet Template 2 | by Rob Glazebrook of CSSnewbie.com 3 | Last Updated: June 4, 2008 4 | 5 | Feel free (nay, compelled) to edit, append, and 6 | manipulate this file as you see fit. */ 7 | 8 | 9 | /* SECTION 1: Set default width, margin, float, and 10 | background. This prevents elements from extending 11 | beyond the edge of the printed page, and prevents 12 | unnecessary background images from printing */ 13 | 14 | * { 15 | -webkit-print-color-adjust: exact; 16 | } 17 | 18 | body { 19 | margin: 0 auto !important; 20 | border: 0; 21 | padding: 0; 22 | float: none !important; 23 | overflow: visible; 24 | } 25 | 26 | html { 27 | width: 100%; 28 | height: 100%; 29 | overflow: visible; 30 | } 31 | 32 | /* SECTION 2: Remove any elements not needed in print. 33 | This would include navigation, ads, sidebars, etc. */ 34 | .nestedarrow, 35 | .reveal .controls, 36 | .reveal .progress, 37 | .reveal .slide-number, 38 | .reveal .playback, 39 | .reveal.overview, 40 | .fork-reveal, 41 | .share-reveal, 42 | .state-background { 43 | display: none !important; 44 | } 45 | 46 | /* SECTION 3: Set body font face, size, and color. 47 | Consider using a serif font for readability. */ 48 | body, p, td, li, div { 49 | 50 | } 51 | 52 | /* SECTION 4: Set heading font face, sizes, and color. 53 | Differentiate your headings from your body text. 54 | Perhaps use a large sans-serif for distinction. */ 55 | h1,h2,h3,h4,h5,h6 { 56 | text-shadow: 0 0 0 #000 !important; 57 | } 58 | 59 | .reveal pre code { 60 | overflow: hidden !important; 61 | font-family: Courier, 'Courier New', monospace !important; 62 | } 63 | 64 | 65 | /* SECTION 5: more reveal.js specific additions by @skypanther */ 66 | ul, ol, div, p { 67 | visibility: visible; 68 | position: static; 69 | width: auto; 70 | height: auto; 71 | display: block; 72 | overflow: visible; 73 | margin: auto; 74 | } 75 | .reveal { 76 | width: auto !important; 77 | height: auto !important; 78 | overflow: hidden !important; 79 | } 80 | .reveal .slides { 81 | position: static; 82 | width: 100%; 83 | height: auto; 84 | 85 | left: auto; 86 | top: auto; 87 | margin: 0 !important; 88 | padding: 0 !important; 89 | 90 | overflow: visible; 91 | display: block; 92 | 93 | -webkit-perspective: none; 94 | -moz-perspective: none; 95 | -ms-perspective: none; 96 | perspective: none; 97 | 98 | -webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */ 99 | -moz-perspective-origin: 50% 50%; 100 | -ms-perspective-origin: 50% 50%; 101 | perspective-origin: 50% 50%; 102 | } 103 | .reveal .slides section { 104 | page-break-after: always !important; 105 | 106 | visibility: visible !important; 107 | position: relative !important; 108 | display: block !important; 109 | position: relative !important; 110 | 111 | margin: 0 !important; 112 | padding: 0 !important; 113 | box-sizing: border-box !important; 114 | min-height: 1px; 115 | 116 | opacity: 1 !important; 117 | 118 | -webkit-transform-style: flat !important; 119 | -moz-transform-style: flat !important; 120 | -ms-transform-style: flat !important; 121 | transform-style: flat !important; 122 | 123 | -webkit-transform: none !important; 124 | -moz-transform: none !important; 125 | -ms-transform: none !important; 126 | transform: none !important; 127 | } 128 | .reveal section.stack { 129 | margin: 0 !important; 130 | padding: 0 !important; 131 | page-break-after: avoid !important; 132 | height: auto !important; 133 | min-height: auto !important; 134 | } 135 | .reveal img { 136 | box-shadow: none; 137 | } 138 | .reveal .roll { 139 | overflow: visible; 140 | line-height: 1em; 141 | } 142 | 143 | /* Slide backgrounds are placed inside of their slide when exporting to PDF */ 144 | .reveal section .slide-background { 145 | display: block !important; 146 | position: absolute; 147 | top: 0; 148 | left: 0; 149 | width: 100%; 150 | z-index: -1; 151 | } 152 | /* All elements should be above the slide-background */ 153 | .reveal section>* { 154 | position: relative; 155 | z-index: 1; 156 | } 157 | 158 | -------------------------------------------------------------------------------- /css/theme/README.md: -------------------------------------------------------------------------------- 1 | ## Dependencies 2 | 3 | Themes are written using Sass to keep things modular and reduce the need for repeated selectors across files. Make sure that you have the reveal.js development environment including the Grunt dependencies installed before proceding: https://github.com/hakimel/reveal.js#full-setup 4 | 5 | You also need to install Ruby and then Sass (with `gem install sass`). 6 | 7 | ## Creating a Theme 8 | 9 | To create your own theme, start by duplicating any ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source) and adding it to the compilation list in the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js). 10 | 11 | Each theme file does four things in the following order: 12 | 13 | 1. **Include [/css/theme/template/mixins.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/mixins.scss)** 14 | Shared utility functions. 15 | 16 | 2. **Include [/css/theme/template/settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss)** 17 | Declares a set of custom variables that the template file (step 4) expects. Can be overridden in step 3. 18 | 19 | 3. **Override** 20 | This is where you override the default theme. Either by specifying variables (see [settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss) for reference) or by adding full selectors with hardcoded styles. 21 | 22 | 4. **Include [/css/theme/template/theme.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/theme.scss)** 23 | The template theme file which will generate final CSS output based on the currently defined variables. 24 | 25 | When you are done, run `grunt css-themes` to compile the Sass file to CSS and you are ready to use your new theme. 26 | -------------------------------------------------------------------------------- /css/theme/moon.css: -------------------------------------------------------------------------------- 1 | @import url(../../lib/font/league-gothic/league-gothic.css); 2 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 3 | /** 4 | * Solarized Dark theme for reveal.js. 5 | * Author: Achim Staebler 6 | */ 7 | /** 8 | * Solarized colors by Ethan Schoonover 9 | */ 10 | html * { 11 | color-profile: sRGB; 12 | rendering-intent: auto; } 13 | 14 | /********************************************* 15 | * GLOBAL STYLES 16 | *********************************************/ 17 | body { 18 | background: #002b36; 19 | background-color: #002b36; } 20 | 21 | .reveal { 22 | font-family: 'Lato', sans-serif; 23 | font-size: 36px; 24 | font-weight: normal; 25 | color: #93a1a1; } 26 | 27 | ::selection { 28 | color: #fff; 29 | background: #d33682; 30 | text-shadow: none; } 31 | 32 | .reveal .slides > section, .reveal .slides > section > section { 33 | line-height: 1.3; 34 | font-weight: inherit; } 35 | 36 | /********************************************* 37 | * HEADERS 38 | *********************************************/ 39 | .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { 40 | margin: 0 0 20px 0; 41 | color: #eee8d5; 42 | font-family: 'League Gothic', Impact, sans-serif; 43 | font-weight: normal; 44 | line-height: 1.2; 45 | letter-spacing: normal; 46 | text-transform: uppercase; 47 | text-shadow: none; 48 | word-wrap: break-word; } 49 | 50 | .reveal h1 { 51 | font-size: 3.77em; } 52 | 53 | .reveal h2 { 54 | font-size: 2.11em; } 55 | 56 | .reveal h3 { 57 | font-size: 1.55em; } 58 | 59 | .reveal h4 { 60 | font-size: 1em; } 61 | 62 | .reveal h1 { 63 | text-shadow: none; } 64 | 65 | /********************************************* 66 | * OTHER 67 | *********************************************/ 68 | .reveal p { 69 | margin: 20px 0; 70 | line-height: 1.3; } 71 | 72 | /* Ensure certain elements are never larger than the slide itself */ 73 | .reveal img, .reveal video, .reveal iframe { 74 | max-width: 95%; 75 | max-height: 95%; } 76 | 77 | .reveal strong, .reveal b { 78 | font-weight: bold; } 79 | 80 | .reveal em { 81 | font-style: italic; } 82 | 83 | .reveal ol, .reveal dl, .reveal ul { 84 | display: inline-block; 85 | text-align: left; 86 | margin: 0 0 0 1em; } 87 | 88 | .reveal ol { 89 | list-style-type: decimal; } 90 | 91 | .reveal ul { 92 | list-style-type: disc; } 93 | 94 | .reveal ul ul { 95 | list-style-type: square; } 96 | 97 | .reveal ul ul ul { 98 | list-style-type: circle; } 99 | 100 | .reveal ul ul, .reveal ul ol, .reveal ol ol, .reveal ol ul { 101 | display: block; 102 | margin-left: 40px; } 103 | 104 | .reveal dt { 105 | font-weight: bold; } 106 | 107 | .reveal dd { 108 | margin-left: 40px; } 109 | 110 | .reveal q, .reveal blockquote { 111 | quotes: none; } 112 | 113 | .reveal blockquote { 114 | display: block; 115 | position: relative; 116 | width: 70%; 117 | margin: 20px auto; 118 | padding: 5px; 119 | font-style: italic; 120 | background: rgba(255, 255, 255, 0.05); 121 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 122 | 123 | .reveal blockquote p:first-child, .reveal blockquote p:last-child { 124 | display: inline-block; } 125 | 126 | .reveal q { 127 | font-style: italic; } 128 | 129 | .reveal pre { 130 | display: block; 131 | position: relative; 132 | width: 90%; 133 | margin: 20px auto; 134 | text-align: left; 135 | font-size: 0.55em; 136 | font-family: monospace; 137 | line-height: 1.2em; 138 | word-wrap: break-word; 139 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 140 | 141 | .reveal code { 142 | font-family: monospace; } 143 | 144 | .reveal pre code { 145 | display: block; 146 | padding: 5px; 147 | overflow: auto; 148 | max-height: 400px; 149 | word-wrap: normal; 150 | background: #3F3F3F; 151 | color: #DCDCDC; } 152 | 153 | .reveal table { 154 | margin: auto; 155 | border-collapse: collapse; 156 | border-spacing: 0; } 157 | 158 | .reveal table th { 159 | font-weight: bold; } 160 | 161 | .reveal table th, .reveal table td { 162 | text-align: left; 163 | padding: 0.2em 0.5em 0.2em 0.5em; 164 | border-bottom: 1px solid; } 165 | 166 | .reveal table tr:last-child td { 167 | border-bottom: none; } 168 | 169 | .reveal sup { 170 | vertical-align: super; } 171 | 172 | .reveal sub { 173 | vertical-align: sub; } 174 | 175 | .reveal small { 176 | display: inline-block; 177 | font-size: 0.6em; 178 | line-height: 1.2em; 179 | vertical-align: top; } 180 | 181 | .reveal small * { 182 | vertical-align: top; } 183 | 184 | /********************************************* 185 | * LINKS 186 | *********************************************/ 187 | .reveal a { 188 | color: #268bd2; 189 | text-decoration: none; 190 | -webkit-transition: color 0.15s ease; 191 | -moz-transition: color 0.15s ease; 192 | transition: color 0.15s ease; } 193 | 194 | .reveal a:hover { 195 | color: #78bae6; 196 | text-shadow: none; 197 | border: none; } 198 | 199 | .reveal .roll span:after { 200 | color: #fff; 201 | background: #1a6291; } 202 | 203 | /********************************************* 204 | * IMAGES 205 | *********************************************/ 206 | .reveal section img { 207 | margin: 15px 0px; 208 | background: rgba(255, 255, 255, 0.12); 209 | border: 4px solid #93a1a1; 210 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 211 | 212 | .reveal a img { 213 | -webkit-transition: all 0.15s linear; 214 | -moz-transition: all 0.15s linear; 215 | transition: all 0.15s linear; } 216 | 217 | .reveal a:hover img { 218 | background: rgba(255, 255, 255, 0.2); 219 | border-color: #268bd2; 220 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 221 | 222 | /********************************************* 223 | * NAVIGATION CONTROLS 224 | *********************************************/ 225 | .reveal .controls div.navigate-left, .reveal .controls div.navigate-left.enabled { 226 | border-right-color: #268bd2; } 227 | 228 | .reveal .controls div.navigate-right, .reveal .controls div.navigate-right.enabled { 229 | border-left-color: #268bd2; } 230 | 231 | .reveal .controls div.navigate-up, .reveal .controls div.navigate-up.enabled { 232 | border-bottom-color: #268bd2; } 233 | 234 | .reveal .controls div.navigate-down, .reveal .controls div.navigate-down.enabled { 235 | border-top-color: #268bd2; } 236 | 237 | .reveal .controls div.navigate-left.enabled:hover { 238 | border-right-color: #78bae6; } 239 | 240 | .reveal .controls div.navigate-right.enabled:hover { 241 | border-left-color: #78bae6; } 242 | 243 | .reveal .controls div.navigate-up.enabled:hover { 244 | border-bottom-color: #78bae6; } 245 | 246 | .reveal .controls div.navigate-down.enabled:hover { 247 | border-top-color: #78bae6; } 248 | 249 | /********************************************* 250 | * PROGRESS BAR 251 | *********************************************/ 252 | .reveal .progress { 253 | background: rgba(0, 0, 0, 0.2); } 254 | 255 | .reveal .progress span { 256 | background: #268bd2; 257 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 258 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 259 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 260 | 261 | /********************************************* 262 | * SLIDE NUMBER 263 | *********************************************/ 264 | .reveal .slide-number { 265 | color: #268bd2; } 266 | -------------------------------------------------------------------------------- /css/theme/night.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 2 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); 3 | /** 4 | * Black theme for reveal.js. 5 | * 6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | /********************************************* 9 | * GLOBAL STYLES 10 | *********************************************/ 11 | body { 12 | background: #111; 13 | background-color: #111; } 14 | 15 | .reveal { 16 | font-family: 'Open Sans', sans-serif; 17 | font-size: 30px; 18 | font-weight: normal; 19 | color: #eee; } 20 | 21 | ::selection { 22 | color: #fff; 23 | background: #e7ad52; 24 | text-shadow: none; } 25 | 26 | .reveal .slides > section, .reveal .slides > section > section { 27 | line-height: 1.3; 28 | font-weight: inherit; } 29 | 30 | /********************************************* 31 | * HEADERS 32 | *********************************************/ 33 | .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { 34 | margin: 0 0 20px 0; 35 | color: #eee; 36 | font-family: 'Montserrat', Impact, sans-serif; 37 | font-weight: normal; 38 | line-height: 1.2; 39 | letter-spacing: -0.03em; 40 | text-transform: none; 41 | text-shadow: none; 42 | word-wrap: break-word; } 43 | 44 | .reveal h1 { 45 | font-size: 3.77em; } 46 | 47 | .reveal h2 { 48 | font-size: 2.11em; } 49 | 50 | .reveal h3 { 51 | font-size: 1.55em; } 52 | 53 | .reveal h4 { 54 | font-size: 1em; } 55 | 56 | .reveal h1 { 57 | text-shadow: none; } 58 | 59 | /********************************************* 60 | * OTHER 61 | *********************************************/ 62 | .reveal p { 63 | margin: 20px 0; 64 | line-height: 1.3; } 65 | 66 | /* Ensure certain elements are never larger than the slide itself */ 67 | .reveal img, .reveal video, .reveal iframe { 68 | max-width: 95%; 69 | max-height: 95%; } 70 | 71 | .reveal strong, .reveal b { 72 | font-weight: bold; } 73 | 74 | .reveal em { 75 | font-style: italic; } 76 | 77 | .reveal ol, .reveal dl, .reveal ul { 78 | display: inline-block; 79 | text-align: left; 80 | margin: 0 0 0 1em; } 81 | 82 | .reveal ol { 83 | list-style-type: decimal; } 84 | 85 | .reveal ul { 86 | list-style-type: disc; } 87 | 88 | .reveal ul ul { 89 | list-style-type: square; } 90 | 91 | .reveal ul ul ul { 92 | list-style-type: circle; } 93 | 94 | .reveal ul ul, .reveal ul ol, .reveal ol ol, .reveal ol ul { 95 | display: block; 96 | margin-left: 40px; } 97 | 98 | .reveal dt { 99 | font-weight: bold; } 100 | 101 | .reveal dd { 102 | margin-left: 40px; } 103 | 104 | .reveal q, .reveal blockquote { 105 | quotes: none; } 106 | 107 | .reveal blockquote { 108 | display: block; 109 | position: relative; 110 | width: 70%; 111 | margin: 20px auto; 112 | padding: 5px; 113 | font-style: italic; 114 | background: rgba(255, 255, 255, 0.05); 115 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 116 | 117 | .reveal blockquote p:first-child, .reveal blockquote p:last-child { 118 | display: inline-block; } 119 | 120 | .reveal q { 121 | font-style: italic; } 122 | 123 | .reveal pre { 124 | display: block; 125 | position: relative; 126 | width: 90%; 127 | margin: 20px auto; 128 | text-align: left; 129 | font-size: 0.55em; 130 | font-family: monospace; 131 | line-height: 1.2em; 132 | word-wrap: break-word; 133 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 134 | 135 | .reveal code { 136 | font-family: monospace; } 137 | 138 | .reveal pre code { 139 | display: block; 140 | padding: 5px; 141 | overflow: auto; 142 | max-height: 400px; 143 | word-wrap: normal; 144 | background: #3F3F3F; 145 | color: #DCDCDC; } 146 | 147 | .reveal table { 148 | margin: auto; 149 | border-collapse: collapse; 150 | border-spacing: 0; } 151 | 152 | .reveal table th { 153 | font-weight: bold; } 154 | 155 | .reveal table th, .reveal table td { 156 | text-align: left; 157 | padding: 0.2em 0.5em 0.2em 0.5em; 158 | border-bottom: 1px solid; } 159 | 160 | .reveal table tr:last-child td { 161 | border-bottom: none; } 162 | 163 | .reveal sup { 164 | vertical-align: super; } 165 | 166 | .reveal sub { 167 | vertical-align: sub; } 168 | 169 | .reveal small { 170 | display: inline-block; 171 | font-size: 0.6em; 172 | line-height: 1.2em; 173 | vertical-align: top; } 174 | 175 | .reveal small * { 176 | vertical-align: top; } 177 | 178 | /********************************************* 179 | * LINKS 180 | *********************************************/ 181 | .reveal a { 182 | color: #e7ad52; 183 | text-decoration: none; 184 | -webkit-transition: color 0.15s ease; 185 | -moz-transition: color 0.15s ease; 186 | transition: color 0.15s ease; } 187 | 188 | .reveal a:hover { 189 | color: #f3d7ac; 190 | text-shadow: none; 191 | border: none; } 192 | 193 | .reveal .roll span:after { 194 | color: #fff; 195 | background: #d0881d; } 196 | 197 | /********************************************* 198 | * IMAGES 199 | *********************************************/ 200 | .reveal section img { 201 | margin: 15px 0px; 202 | background: rgba(255, 255, 255, 0.12); 203 | border: 4px solid #eee; 204 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 205 | 206 | .reveal a img { 207 | -webkit-transition: all 0.15s linear; 208 | -moz-transition: all 0.15s linear; 209 | transition: all 0.15s linear; } 210 | 211 | .reveal a:hover img { 212 | background: rgba(255, 255, 255, 0.2); 213 | border-color: #e7ad52; 214 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 215 | 216 | /********************************************* 217 | * NAVIGATION CONTROLS 218 | *********************************************/ 219 | .reveal .controls div.navigate-left, .reveal .controls div.navigate-left.enabled { 220 | border-right-color: #e7ad52; } 221 | 222 | .reveal .controls div.navigate-right, .reveal .controls div.navigate-right.enabled { 223 | border-left-color: #e7ad52; } 224 | 225 | .reveal .controls div.navigate-up, .reveal .controls div.navigate-up.enabled { 226 | border-bottom-color: #e7ad52; } 227 | 228 | .reveal .controls div.navigate-down, .reveal .controls div.navigate-down.enabled { 229 | border-top-color: #e7ad52; } 230 | 231 | .reveal .controls div.navigate-left.enabled:hover { 232 | border-right-color: #f3d7ac; } 233 | 234 | .reveal .controls div.navigate-right.enabled:hover { 235 | border-left-color: #f3d7ac; } 236 | 237 | .reveal .controls div.navigate-up.enabled:hover { 238 | border-bottom-color: #f3d7ac; } 239 | 240 | .reveal .controls div.navigate-down.enabled:hover { 241 | border-top-color: #f3d7ac; } 242 | 243 | /********************************************* 244 | * PROGRESS BAR 245 | *********************************************/ 246 | .reveal .progress { 247 | background: rgba(0, 0, 0, 0.2); } 248 | 249 | .reveal .progress span { 250 | background: #e7ad52; 251 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 252 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 253 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 254 | 255 | /********************************************* 256 | * SLIDE NUMBER 257 | *********************************************/ 258 | .reveal .slide-number { 259 | color: #e7ad52; } 260 | -------------------------------------------------------------------------------- /css/theme/serif.css: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is brown. 4 | * 5 | * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed. 6 | */ 7 | .reveal a { 8 | line-height: 1.3em; } 9 | 10 | /********************************************* 11 | * GLOBAL STYLES 12 | *********************************************/ 13 | body { 14 | background: #F0F1EB; 15 | background-color: #F0F1EB; } 16 | 17 | .reveal { 18 | font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 19 | font-size: 36px; 20 | font-weight: normal; 21 | color: #000; } 22 | 23 | ::selection { 24 | color: #fff; 25 | background: #26351C; 26 | text-shadow: none; } 27 | 28 | .reveal .slides > section, .reveal .slides > section > section { 29 | line-height: 1.3; 30 | font-weight: inherit; } 31 | 32 | /********************************************* 33 | * HEADERS 34 | *********************************************/ 35 | .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { 36 | margin: 0 0 20px 0; 37 | color: #383D3D; 38 | font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 39 | font-weight: normal; 40 | line-height: 1.2; 41 | letter-spacing: normal; 42 | text-transform: none; 43 | text-shadow: none; 44 | word-wrap: break-word; } 45 | 46 | .reveal h1 { 47 | font-size: 3.77em; } 48 | 49 | .reveal h2 { 50 | font-size: 2.11em; } 51 | 52 | .reveal h3 { 53 | font-size: 1.55em; } 54 | 55 | .reveal h4 { 56 | font-size: 1em; } 57 | 58 | .reveal h1 { 59 | text-shadow: none; } 60 | 61 | /********************************************* 62 | * OTHER 63 | *********************************************/ 64 | .reveal p { 65 | margin: 20px 0; 66 | line-height: 1.3; } 67 | 68 | /* Ensure certain elements are never larger than the slide itself */ 69 | .reveal img, .reveal video, .reveal iframe { 70 | max-width: 95%; 71 | max-height: 95%; } 72 | 73 | .reveal strong, .reveal b { 74 | font-weight: bold; } 75 | 76 | .reveal em { 77 | font-style: italic; } 78 | 79 | .reveal ol, .reveal dl, .reveal ul { 80 | display: inline-block; 81 | text-align: left; 82 | margin: 0 0 0 1em; } 83 | 84 | .reveal ol { 85 | list-style-type: decimal; } 86 | 87 | .reveal ul { 88 | list-style-type: disc; } 89 | 90 | .reveal ul ul { 91 | list-style-type: square; } 92 | 93 | .reveal ul ul ul { 94 | list-style-type: circle; } 95 | 96 | .reveal ul ul, .reveal ul ol, .reveal ol ol, .reveal ol ul { 97 | display: block; 98 | margin-left: 40px; } 99 | 100 | .reveal dt { 101 | font-weight: bold; } 102 | 103 | .reveal dd { 104 | margin-left: 40px; } 105 | 106 | .reveal q, .reveal blockquote { 107 | quotes: none; } 108 | 109 | .reveal blockquote { 110 | display: block; 111 | position: relative; 112 | width: 70%; 113 | margin: 20px auto; 114 | padding: 5px; 115 | font-style: italic; 116 | background: rgba(255, 255, 255, 0.05); 117 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 118 | 119 | .reveal blockquote p:first-child, .reveal blockquote p:last-child { 120 | display: inline-block; } 121 | 122 | .reveal q { 123 | font-style: italic; } 124 | 125 | .reveal pre { 126 | display: block; 127 | position: relative; 128 | width: 90%; 129 | margin: 20px auto; 130 | text-align: left; 131 | font-size: 0.55em; 132 | font-family: monospace; 133 | line-height: 1.2em; 134 | word-wrap: break-word; 135 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 136 | 137 | .reveal code { 138 | font-family: monospace; } 139 | 140 | .reveal pre code { 141 | display: block; 142 | padding: 5px; 143 | overflow: auto; 144 | max-height: 400px; 145 | word-wrap: normal; 146 | background: #3F3F3F; 147 | color: #DCDCDC; } 148 | 149 | .reveal table { 150 | margin: auto; 151 | border-collapse: collapse; 152 | border-spacing: 0; } 153 | 154 | .reveal table th { 155 | font-weight: bold; } 156 | 157 | .reveal table th, .reveal table td { 158 | text-align: left; 159 | padding: 0.2em 0.5em 0.2em 0.5em; 160 | border-bottom: 1px solid; } 161 | 162 | .reveal table tr:last-child td { 163 | border-bottom: none; } 164 | 165 | .reveal sup { 166 | vertical-align: super; } 167 | 168 | .reveal sub { 169 | vertical-align: sub; } 170 | 171 | .reveal small { 172 | display: inline-block; 173 | font-size: 0.6em; 174 | line-height: 1.2em; 175 | vertical-align: top; } 176 | 177 | .reveal small * { 178 | vertical-align: top; } 179 | 180 | /********************************************* 181 | * LINKS 182 | *********************************************/ 183 | .reveal a { 184 | color: #51483D; 185 | text-decoration: none; 186 | -webkit-transition: color 0.15s ease; 187 | -moz-transition: color 0.15s ease; 188 | transition: color 0.15s ease; } 189 | 190 | .reveal a:hover { 191 | color: #8b7b69; 192 | text-shadow: none; 193 | border: none; } 194 | 195 | .reveal .roll span:after { 196 | color: #fff; 197 | background: #25211c; } 198 | 199 | /********************************************* 200 | * IMAGES 201 | *********************************************/ 202 | .reveal section img { 203 | margin: 15px 0px; 204 | background: rgba(255, 255, 255, 0.12); 205 | border: 4px solid #000; 206 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 207 | 208 | .reveal a img { 209 | -webkit-transition: all 0.15s linear; 210 | -moz-transition: all 0.15s linear; 211 | transition: all 0.15s linear; } 212 | 213 | .reveal a:hover img { 214 | background: rgba(255, 255, 255, 0.2); 215 | border-color: #51483D; 216 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 217 | 218 | /********************************************* 219 | * NAVIGATION CONTROLS 220 | *********************************************/ 221 | .reveal .controls div.navigate-left, .reveal .controls div.navigate-left.enabled { 222 | border-right-color: #51483D; } 223 | 224 | .reveal .controls div.navigate-right, .reveal .controls div.navigate-right.enabled { 225 | border-left-color: #51483D; } 226 | 227 | .reveal .controls div.navigate-up, .reveal .controls div.navigate-up.enabled { 228 | border-bottom-color: #51483D; } 229 | 230 | .reveal .controls div.navigate-down, .reveal .controls div.navigate-down.enabled { 231 | border-top-color: #51483D; } 232 | 233 | .reveal .controls div.navigate-left.enabled:hover { 234 | border-right-color: #8b7b69; } 235 | 236 | .reveal .controls div.navigate-right.enabled:hover { 237 | border-left-color: #8b7b69; } 238 | 239 | .reveal .controls div.navigate-up.enabled:hover { 240 | border-bottom-color: #8b7b69; } 241 | 242 | .reveal .controls div.navigate-down.enabled:hover { 243 | border-top-color: #8b7b69; } 244 | 245 | /********************************************* 246 | * PROGRESS BAR 247 | *********************************************/ 248 | .reveal .progress { 249 | background: rgba(0, 0, 0, 0.2); } 250 | 251 | .reveal .progress span { 252 | background: #51483D; 253 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 254 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 255 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 256 | 257 | /********************************************* 258 | * SLIDE NUMBER 259 | *********************************************/ 260 | .reveal .slide-number { 261 | color: #51483D; } 262 | -------------------------------------------------------------------------------- /css/theme/solarized.css: -------------------------------------------------------------------------------- 1 | @import url(../../lib/font/league-gothic/league-gothic.css); 2 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 3 | /** 4 | * Solarized Light theme for reveal.js. 5 | * Author: Achim Staebler 6 | */ 7 | /** 8 | * Solarized colors by Ethan Schoonover 9 | */ 10 | html * { 11 | color-profile: sRGB; 12 | rendering-intent: auto; } 13 | 14 | /********************************************* 15 | * GLOBAL STYLES 16 | *********************************************/ 17 | body { 18 | background: #fdf6e3; 19 | background-color: #fdf6e3; } 20 | 21 | .reveal { 22 | font-family: 'Lato', sans-serif; 23 | font-size: 36px; 24 | font-weight: normal; 25 | color: #657b83; } 26 | 27 | ::selection { 28 | color: #fff; 29 | background: #d33682; 30 | text-shadow: none; } 31 | 32 | .reveal .slides > section, .reveal .slides > section > section { 33 | line-height: 1.3; 34 | font-weight: inherit; } 35 | 36 | /********************************************* 37 | * HEADERS 38 | *********************************************/ 39 | .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { 40 | margin: 0 0 20px 0; 41 | color: #586e75; 42 | font-family: 'League Gothic', Impact, sans-serif; 43 | font-weight: normal; 44 | line-height: 1.2; 45 | letter-spacing: normal; 46 | text-transform: uppercase; 47 | text-shadow: none; 48 | word-wrap: break-word; } 49 | 50 | .reveal h1 { 51 | font-size: 3.77em; } 52 | 53 | .reveal h2 { 54 | font-size: 2.11em; } 55 | 56 | .reveal h3 { 57 | font-size: 1.55em; } 58 | 59 | .reveal h4 { 60 | font-size: 1em; } 61 | 62 | .reveal h1 { 63 | text-shadow: none; } 64 | 65 | /********************************************* 66 | * OTHER 67 | *********************************************/ 68 | .reveal p { 69 | margin: 20px 0; 70 | line-height: 1.3; } 71 | 72 | /* Ensure certain elements are never larger than the slide itself */ 73 | .reveal img, .reveal video, .reveal iframe { 74 | max-width: 95%; 75 | max-height: 95%; } 76 | 77 | .reveal strong, .reveal b { 78 | font-weight: bold; } 79 | 80 | .reveal em { 81 | font-style: italic; } 82 | 83 | .reveal ol, .reveal dl, .reveal ul { 84 | display: inline-block; 85 | text-align: left; 86 | margin: 0 0 0 1em; } 87 | 88 | .reveal ol { 89 | list-style-type: decimal; } 90 | 91 | .reveal ul { 92 | list-style-type: disc; } 93 | 94 | .reveal ul ul { 95 | list-style-type: square; } 96 | 97 | .reveal ul ul ul { 98 | list-style-type: circle; } 99 | 100 | .reveal ul ul, .reveal ul ol, .reveal ol ol, .reveal ol ul { 101 | display: block; 102 | margin-left: 40px; } 103 | 104 | .reveal dt { 105 | font-weight: bold; } 106 | 107 | .reveal dd { 108 | margin-left: 40px; } 109 | 110 | .reveal q, .reveal blockquote { 111 | quotes: none; } 112 | 113 | .reveal blockquote { 114 | display: block; 115 | position: relative; 116 | width: 70%; 117 | margin: 20px auto; 118 | padding: 5px; 119 | font-style: italic; 120 | background: rgba(255, 255, 255, 0.05); 121 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 122 | 123 | .reveal blockquote p:first-child, .reveal blockquote p:last-child { 124 | display: inline-block; } 125 | 126 | .reveal q { 127 | font-style: italic; } 128 | 129 | .reveal pre { 130 | display: block; 131 | position: relative; 132 | width: 90%; 133 | margin: 20px auto; 134 | text-align: left; 135 | font-size: 0.55em; 136 | font-family: monospace; 137 | line-height: 1.2em; 138 | word-wrap: break-word; 139 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 140 | 141 | .reveal code { 142 | font-family: monospace; } 143 | 144 | .reveal pre code { 145 | display: block; 146 | padding: 5px; 147 | overflow: auto; 148 | max-height: 400px; 149 | word-wrap: normal; 150 | background: #3F3F3F; 151 | color: #DCDCDC; } 152 | 153 | .reveal table { 154 | margin: auto; 155 | border-collapse: collapse; 156 | border-spacing: 0; } 157 | 158 | .reveal table th { 159 | font-weight: bold; } 160 | 161 | .reveal table th, .reveal table td { 162 | text-align: left; 163 | padding: 0.2em 0.5em 0.2em 0.5em; 164 | border-bottom: 1px solid; } 165 | 166 | .reveal table tr:last-child td { 167 | border-bottom: none; } 168 | 169 | .reveal sup { 170 | vertical-align: super; } 171 | 172 | .reveal sub { 173 | vertical-align: sub; } 174 | 175 | .reveal small { 176 | display: inline-block; 177 | font-size: 0.6em; 178 | line-height: 1.2em; 179 | vertical-align: top; } 180 | 181 | .reveal small * { 182 | vertical-align: top; } 183 | 184 | /********************************************* 185 | * LINKS 186 | *********************************************/ 187 | .reveal a { 188 | color: #268bd2; 189 | text-decoration: none; 190 | -webkit-transition: color 0.15s ease; 191 | -moz-transition: color 0.15s ease; 192 | transition: color 0.15s ease; } 193 | 194 | .reveal a:hover { 195 | color: #78bae6; 196 | text-shadow: none; 197 | border: none; } 198 | 199 | .reveal .roll span:after { 200 | color: #fff; 201 | background: #1a6291; } 202 | 203 | /********************************************* 204 | * IMAGES 205 | *********************************************/ 206 | .reveal section img { 207 | margin: 15px 0px; 208 | background: rgba(255, 255, 255, 0.12); 209 | border: 4px solid #657b83; 210 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 211 | 212 | .reveal a img { 213 | -webkit-transition: all 0.15s linear; 214 | -moz-transition: all 0.15s linear; 215 | transition: all 0.15s linear; } 216 | 217 | .reveal a:hover img { 218 | background: rgba(255, 255, 255, 0.2); 219 | border-color: #268bd2; 220 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 221 | 222 | /********************************************* 223 | * NAVIGATION CONTROLS 224 | *********************************************/ 225 | .reveal .controls div.navigate-left, .reveal .controls div.navigate-left.enabled { 226 | border-right-color: #268bd2; } 227 | 228 | .reveal .controls div.navigate-right, .reveal .controls div.navigate-right.enabled { 229 | border-left-color: #268bd2; } 230 | 231 | .reveal .controls div.navigate-up, .reveal .controls div.navigate-up.enabled { 232 | border-bottom-color: #268bd2; } 233 | 234 | .reveal .controls div.navigate-down, .reveal .controls div.navigate-down.enabled { 235 | border-top-color: #268bd2; } 236 | 237 | .reveal .controls div.navigate-left.enabled:hover { 238 | border-right-color: #78bae6; } 239 | 240 | .reveal .controls div.navigate-right.enabled:hover { 241 | border-left-color: #78bae6; } 242 | 243 | .reveal .controls div.navigate-up.enabled:hover { 244 | border-bottom-color: #78bae6; } 245 | 246 | .reveal .controls div.navigate-down.enabled:hover { 247 | border-top-color: #78bae6; } 248 | 249 | /********************************************* 250 | * PROGRESS BAR 251 | *********************************************/ 252 | .reveal .progress { 253 | background: rgba(0, 0, 0, 0.2); } 254 | 255 | .reveal .progress span { 256 | background: #268bd2; 257 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 258 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 259 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 260 | 261 | /********************************************* 262 | * SLIDE NUMBER 263 | *********************************************/ 264 | .reveal .slide-number { 265 | color: #268bd2; } 266 | -------------------------------------------------------------------------------- /css/theme/source/beige.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Beige theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @import url(../../lib/font/league-gothic/league-gothic.css); 17 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 18 | 19 | 20 | // Override theme settings (see ../template/settings.scss) 21 | $mainColor: #333; 22 | $headingColor: #333; 23 | $headingTextShadow: none; 24 | $backgroundColor: #f7f3de; 25 | $linkColor: #8b743d; 26 | $linkColorHover: lighten( $linkColor, 20% ); 27 | $selectionBackgroundColor: rgba(79, 64, 28, 0.99); 28 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 29 | 30 | // Background generator 31 | @mixin bodyBackground() { 32 | @include radial-gradient( rgba(247,242,211,1), rgba(255,255,255,1) ); 33 | } 34 | 35 | 36 | 37 | // Theme template ------------------------------ 38 | @import "../template/theme"; 39 | // --------------------------------------------- -------------------------------------------------------------------------------- /css/theme/source/black.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Black theme for reveal.js. This is the opposite of the 'white' theme. 3 | * 4 | * Copyright (C) 2015 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css); 16 | 17 | 18 | // Override theme settings (see ../template/settings.scss) 19 | $backgroundColor: #222; 20 | 21 | $mainColor: #fff; 22 | $headingColor: #fff; 23 | 24 | $mainFontSize: 38px; 25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif; 26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif; 27 | $headingTextShadow: none; 28 | $headingLetterSpacing: normal; 29 | $headingTextTransform: uppercase; 30 | $headingFontWeight: 600; 31 | $linkColor: #42affa; 32 | $linkColorHover: lighten( $linkColor, 15% ); 33 | $selectionBackgroundColor: lighten( $linkColor, 25% ); 34 | 35 | $heading1Size: 2.5em; 36 | $heading2Size: 1.6em; 37 | $heading3Size: 1.3em; 38 | $heading4Size: 1.0em; 39 | 40 | section.has-light-background { 41 | &, h1, h2, h3, h4, h5, h6 { 42 | color: #222; 43 | } 44 | } 45 | 46 | 47 | // Theme template ------------------------------ 48 | @import "../template/theme"; 49 | // --------------------------------------------- -------------------------------------------------------------------------------- /css/theme/source/blood.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Blood theme for reveal.js 3 | * Author: Walther http://github.com/Walther 4 | * 5 | * Designed to be used with highlight.js theme 6 | * "monokai_sublime.css" available from 7 | * https://github.com/isagalaev/highlight.js/ 8 | * 9 | * For other themes, change $codeBackground accordingly. 10 | * 11 | */ 12 | 13 | // Default mixins and settings ----------------- 14 | @import "../template/mixins"; 15 | @import "../template/settings"; 16 | // --------------------------------------------- 17 | 18 | // Include theme-specific fonts 19 | 20 | @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,700,300italic,700italic); 21 | 22 | // Colors used in the theme 23 | $blood: #a23; 24 | $coal: #222; 25 | $codeBackground: #23241f; 26 | 27 | // Main text 28 | $mainFont: Ubuntu, 'sans-serif'; 29 | $mainFontSize: 36px; 30 | $mainColor: #eee; 31 | 32 | // Headings 33 | $headingFont: Ubuntu, 'sans-serif'; 34 | $headingTextShadow: 2px 2px 2px $coal; 35 | 36 | // h1 shadow, borrowed humbly from 37 | // (c) Default theme by Hakim El Hattab 38 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 39 | 40 | // Links 41 | $linkColor: $blood; 42 | $linkColorHover: lighten( $linkColor, 20% ); 43 | 44 | // Text selection 45 | $selectionBackgroundColor: $blood; 46 | $selectionColor: #fff; 47 | 48 | // Background generator 49 | @mixin bodyBackground() { 50 | @include radial-gradient( $coal, lighten( $coal, 25% ) ); 51 | } 52 | 53 | // Theme template ------------------------------ 54 | @import "../template/theme"; 55 | // --------------------------------------------- 56 | 57 | // some overrides after theme template import 58 | 59 | .reveal p { 60 | font-weight: 300; 61 | text-shadow: 1px 1px $coal; 62 | } 63 | 64 | .reveal h1, 65 | .reveal h2, 66 | .reveal h3, 67 | .reveal h4, 68 | .reveal h5, 69 | .reveal h6 { 70 | font-weight: 700; 71 | } 72 | 73 | .reveal a, 74 | .reveal a:hover { 75 | text-shadow: 2px 2px 2px #000; 76 | } 77 | 78 | .reveal small a, 79 | .reveal small a:hover { 80 | text-shadow: 1px 1px 1px #000; 81 | } 82 | 83 | .reveal p code { 84 | background-color: $codeBackground; 85 | display: inline-block; 86 | border-radius: 7px; 87 | } 88 | 89 | .reveal small code { 90 | vertical-align: baseline; 91 | } -------------------------------------------------------------------------------- /css/theme/source/league.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * League theme for reveal.js. 3 | * 4 | * This was the default theme pre-3.0.0. 5 | * 6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | 9 | 10 | // Default mixins and settings ----------------- 11 | @import "../template/mixins"; 12 | @import "../template/settings"; 13 | // --------------------------------------------- 14 | 15 | 16 | 17 | // Include theme-specific fonts 18 | @import url(../../lib/font/league-gothic/league-gothic.css); 19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 20 | 21 | // Override theme settings (see ../template/settings.scss) 22 | $headingTextShadow: 0px 0px 6px rgba(0,0,0,0.2); 23 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 24 | 25 | // Background generator 26 | @mixin bodyBackground() { 27 | @include radial-gradient( rgba(28,30,32,1), rgba(85,90,95,1) ); 28 | } 29 | 30 | 31 | 32 | // Theme template ------------------------------ 33 | @import "../template/theme"; 34 | // --------------------------------------------- -------------------------------------------------------------------------------- /css/theme/source/moon.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Dark theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | 6 | 7 | // Default mixins and settings ----------------- 8 | @import "../template/mixins"; 9 | @import "../template/settings"; 10 | // --------------------------------------------- 11 | 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/league-gothic/league-gothic.css); 16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 17 | 18 | /** 19 | * Solarized colors by Ethan Schoonover 20 | */ 21 | html * { 22 | color-profile: sRGB; 23 | rendering-intent: auto; 24 | } 25 | 26 | // Solarized colors 27 | $base03: #002b36; 28 | $base02: #073642; 29 | $base01: #586e75; 30 | $base00: #657b83; 31 | $base0: #839496; 32 | $base1: #93a1a1; 33 | $base2: #eee8d5; 34 | $base3: #fdf6e3; 35 | $yellow: #b58900; 36 | $orange: #cb4b16; 37 | $red: #dc322f; 38 | $magenta: #d33682; 39 | $violet: #6c71c4; 40 | $blue: #268bd2; 41 | $cyan: #2aa198; 42 | $green: #859900; 43 | 44 | // Override theme settings (see ../template/settings.scss) 45 | $mainColor: $base1; 46 | $headingColor: $base2; 47 | $headingTextShadow: none; 48 | $backgroundColor: $base03; 49 | $linkColor: $blue; 50 | $linkColorHover: lighten( $linkColor, 20% ); 51 | $selectionBackgroundColor: $magenta; 52 | 53 | 54 | 55 | // Theme template ------------------------------ 56 | @import "../template/theme"; 57 | // --------------------------------------------- 58 | -------------------------------------------------------------------------------- /css/theme/source/night.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Black theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 16 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); 17 | 18 | 19 | // Override theme settings (see ../template/settings.scss) 20 | $backgroundColor: #111; 21 | 22 | $mainFont: 'Open Sans', sans-serif; 23 | $linkColor: #e7ad52; 24 | $linkColorHover: lighten( $linkColor, 20% ); 25 | $headingFont: 'Montserrat', Impact, sans-serif; 26 | $headingTextShadow: none; 27 | $headingLetterSpacing: -0.03em; 28 | $headingTextTransform: none; 29 | $selectionBackgroundColor: #e7ad52; 30 | $mainFontSize: 30px; 31 | 32 | 33 | // Theme template ------------------------------ 34 | @import "../template/theme"; 35 | // --------------------------------------------- -------------------------------------------------------------------------------- /css/theme/source/serif.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is brown. 4 | * 5 | * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed. 6 | */ 7 | 8 | 9 | // Default mixins and settings ----------------- 10 | @import "../template/mixins"; 11 | @import "../template/settings"; 12 | // --------------------------------------------- 13 | 14 | 15 | 16 | // Override theme settings (see ../template/settings.scss) 17 | $mainFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 18 | $mainColor: #000; 19 | $headingFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 20 | $headingColor: #383D3D; 21 | $headingTextShadow: none; 22 | $headingTextTransform: none; 23 | $backgroundColor: #F0F1EB; 24 | $linkColor: #51483D; 25 | $linkColorHover: lighten( $linkColor, 20% ); 26 | $selectionBackgroundColor: #26351C; 27 | 28 | .reveal a { 29 | line-height: 1.3em; 30 | } 31 | 32 | 33 | // Theme template ------------------------------ 34 | @import "../template/theme"; 35 | // --------------------------------------------- 36 | -------------------------------------------------------------------------------- /css/theme/source/simple.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is darkblue. 4 | * 5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. 6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | 9 | 10 | // Default mixins and settings ----------------- 11 | @import "../template/mixins"; 12 | @import "../template/settings"; 13 | // --------------------------------------------- 14 | 15 | 16 | 17 | // Include theme-specific fonts 18 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); 19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 20 | 21 | 22 | // Override theme settings (see ../template/settings.scss) 23 | $mainFont: 'Lato', sans-serif; 24 | $mainColor: #000; 25 | $headingFont: 'News Cycle', Impact, sans-serif; 26 | $headingColor: #000; 27 | $headingTextShadow: none; 28 | $headingTextTransform: none; 29 | $backgroundColor: #fff; 30 | $linkColor: #00008B; 31 | $linkColorHover: lighten( $linkColor, 20% ); 32 | $selectionBackgroundColor: rgba(0, 0, 0, 0.99); 33 | 34 | 35 | 36 | // Theme template ------------------------------ 37 | @import "../template/theme"; 38 | // --------------------------------------------- -------------------------------------------------------------------------------- /css/theme/source/sky.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Sky theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); 17 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); 18 | 19 | 20 | // Override theme settings (see ../template/settings.scss) 21 | $mainFont: 'Open Sans', sans-serif; 22 | $mainColor: #333; 23 | $headingFont: 'Quicksand', sans-serif; 24 | $headingColor: #333; 25 | $headingLetterSpacing: -0.08em; 26 | $headingTextShadow: none; 27 | $backgroundColor: #f7fbfc; 28 | $linkColor: #3b759e; 29 | $linkColorHover: lighten( $linkColor, 20% ); 30 | $selectionBackgroundColor: #134674; 31 | 32 | // Fix links so they are not cut off 33 | .reveal a { 34 | line-height: 1.3em; 35 | } 36 | 37 | // Background generator 38 | @mixin bodyBackground() { 39 | @include radial-gradient( #add9e4, #f7fbfc ); 40 | } 41 | 42 | 43 | 44 | // Theme template ------------------------------ 45 | @import "../template/theme"; 46 | // --------------------------------------------- 47 | -------------------------------------------------------------------------------- /css/theme/source/solarized.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Light theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | 6 | 7 | // Default mixins and settings ----------------- 8 | @import "../template/mixins"; 9 | @import "../template/settings"; 10 | // --------------------------------------------- 11 | 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/league-gothic/league-gothic.css); 16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 17 | 18 | 19 | /** 20 | * Solarized colors by Ethan Schoonover 21 | */ 22 | html * { 23 | color-profile: sRGB; 24 | rendering-intent: auto; 25 | } 26 | 27 | // Solarized colors 28 | $base03: #002b36; 29 | $base02: #073642; 30 | $base01: #586e75; 31 | $base00: #657b83; 32 | $base0: #839496; 33 | $base1: #93a1a1; 34 | $base2: #eee8d5; 35 | $base3: #fdf6e3; 36 | $yellow: #b58900; 37 | $orange: #cb4b16; 38 | $red: #dc322f; 39 | $magenta: #d33682; 40 | $violet: #6c71c4; 41 | $blue: #268bd2; 42 | $cyan: #2aa198; 43 | $green: #859900; 44 | 45 | // Override theme settings (see ../template/settings.scss) 46 | $mainColor: $base00; 47 | $headingColor: $base01; 48 | $headingTextShadow: none; 49 | $backgroundColor: $base3; 50 | $linkColor: $blue; 51 | $linkColorHover: lighten( $linkColor, 20% ); 52 | $selectionBackgroundColor: $magenta; 53 | 54 | // Background generator 55 | // @mixin bodyBackground() { 56 | // @include radial-gradient( rgba($base3,1), rgba(lighten($base3, 20%),1) ); 57 | // } 58 | 59 | 60 | 61 | // Theme template ------------------------------ 62 | @import "../template/theme"; 63 | // --------------------------------------------- 64 | -------------------------------------------------------------------------------- /css/theme/source/white.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * White theme for reveal.js. This is the opposite of the 'black' theme. 3 | * 4 | * Copyright (C) 2015 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css); 16 | 17 | 18 | // Override theme settings (see ../template/settings.scss) 19 | $backgroundColor: #fff; 20 | 21 | $mainColor: #222; 22 | $headingColor: #222; 23 | 24 | $mainFontSize: 38px; 25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif; 26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif; 27 | $headingTextShadow: none; 28 | $headingLetterSpacing: normal; 29 | $headingTextTransform: uppercase; 30 | $headingFontWeight: 600; 31 | $linkColor: #2a76dd; 32 | $linkColorHover: lighten( $linkColor, 15% ); 33 | $selectionBackgroundColor: lighten( $linkColor, 25% ); 34 | 35 | $heading1Size: 2.5em; 36 | $heading2Size: 1.6em; 37 | $heading3Size: 1.3em; 38 | $heading4Size: 1.0em; 39 | 40 | section.has-dark-background { 41 | &, h1, h2, h3, h4, h5, h6 { 42 | color: #fff; 43 | } 44 | } 45 | 46 | 47 | // Theme template ------------------------------ 48 | @import "../template/theme"; 49 | // --------------------------------------------- -------------------------------------------------------------------------------- /css/theme/template/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin vertical-gradient( $top, $bottom ) { 2 | background: $top; 3 | background: -moz-linear-gradient( top, $top 0%, $bottom 100% ); 4 | background: -webkit-gradient( linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom) ); 5 | background: -webkit-linear-gradient( top, $top 0%, $bottom 100% ); 6 | background: -o-linear-gradient( top, $top 0%, $bottom 100% ); 7 | background: -ms-linear-gradient( top, $top 0%, $bottom 100% ); 8 | background: linear-gradient( top, $top 0%, $bottom 100% ); 9 | } 10 | 11 | @mixin horizontal-gradient( $top, $bottom ) { 12 | background: $top; 13 | background: -moz-linear-gradient( left, $top 0%, $bottom 100% ); 14 | background: -webkit-gradient( linear, left top, right top, color-stop(0%,$top), color-stop(100%,$bottom) ); 15 | background: -webkit-linear-gradient( left, $top 0%, $bottom 100% ); 16 | background: -o-linear-gradient( left, $top 0%, $bottom 100% ); 17 | background: -ms-linear-gradient( left, $top 0%, $bottom 100% ); 18 | background: linear-gradient( left, $top 0%, $bottom 100% ); 19 | } 20 | 21 | @mixin radial-gradient( $outer, $inner, $type: circle ) { 22 | background: $outer; 23 | background: -moz-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 24 | background: -webkit-gradient( radial, center center, 0px, center center, 100%, color-stop(0%,$inner), color-stop(100%,$outer) ); 25 | background: -webkit-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 26 | background: -o-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 27 | background: -ms-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 28 | background: radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 29 | } -------------------------------------------------------------------------------- /css/theme/template/settings.scss: -------------------------------------------------------------------------------- 1 | // Base settings for all themes that can optionally be 2 | // overridden by the super-theme 3 | 4 | // Background of the presentation 5 | $backgroundColor: #2b2b2b; 6 | 7 | // Primary/body text 8 | $mainFont: 'Lato', sans-serif; 9 | $mainFontSize: 36px; 10 | $mainColor: #eee; 11 | 12 | // Vertical spacing between blocks of text 13 | $blockMargin: 20px; 14 | 15 | // Headings 16 | $headingMargin: 0 0 $blockMargin 0; 17 | $headingFont: 'League Gothic', Impact, sans-serif; 18 | $headingColor: #eee; 19 | $headingLineHeight: 1.2; 20 | $headingLetterSpacing: normal; 21 | $headingTextTransform: uppercase; 22 | $headingTextShadow: none; 23 | $headingFontWeight: normal; 24 | $heading1TextShadow: $headingTextShadow; 25 | 26 | $heading1Size: 3.77em; 27 | $heading2Size: 2.11em; 28 | $heading3Size: 1.55em; 29 | $heading4Size: 1.00em; 30 | 31 | // Links and actions 32 | $linkColor: #13DAEC; 33 | $linkColorHover: lighten( $linkColor, 20% ); 34 | 35 | // Text selection 36 | $selectionBackgroundColor: #FF5E99; 37 | $selectionColor: #fff; 38 | 39 | // Generates the presentation background, can be overridden 40 | // to return a background image or gradient 41 | @mixin bodyBackground() { 42 | background: $backgroundColor; 43 | } -------------------------------------------------------------------------------- /datasets/benchmark.including.compile.json: -------------------------------------------------------------------------------- 1 | { 2 | "chart": { 3 | "type": "column" 4 | }, 5 | "legend": { 6 | "enabled": false 7 | }, 8 | "xAxis": { 9 | "type": "category" 10 | }, 11 | "title": { 12 | "text": "Including various metaprogramming libraries" 13 | }, 14 | "plotOptions": { 15 | "series": { 16 | "borderWidth": 0, 17 | "dataLabels": { 18 | "enabled": true, 19 | "format": "{point.y:.5f}s" 20 | } 21 | } 22 | }, 23 | "series": [{ 24 | "name": "Include time", 25 | "colorByPoint": true, 26 | "data": [ 27 | { 28 | "name": "Boost.Hana", 29 | "y": 0.305033278 30 | }, { 31 | "name": "Boost.MPL", 32 | "y": 1.1913464508 33 | }, { 34 | "name": "Boost.Fusion", 35 | "y": 1.457683804 36 | } 37 | ] 38 | }] 39 | } -------------------------------------------------------------------------------- /datasets/benchmark.transform.compile.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "text": "Compile-time behavior of transform" 4 | }, 5 | "series": [ 6 | { 7 | "name": "hana::tuple", 8 | "data": [[0, 0.104126403], [5, 0.116906371], [10, 0.123750471], [15, 0.128825593], [20, 0.134850116], [25, 0.145283817], [30, 0.147540604], [35, 0.154561307], [40, 0.161784982], [45, 0.171031568], [50, 0.175802999], [75, 0.215912855], [100, 0.244627935], [125, 0.288184634], [150, 0.322031426], [175, 0.359010618], [200, 0.399881663], [225, 0.446622556], [250, 0.492801226], [275, 0.528004499], [300, 0.582351235], [325, 0.622785754], [350, 0.656130331], [375, 0.713500582], [400, 0.809174602]] 9 | }, { 10 | "name": "mpl::vector", 11 | "data": [[0, 0.193865813], [5, 0.195291789], [10, 0.210056716], [15, 0.211366928], [20, 0.227404221], [25, 0.240373505], [30, 0.451475774], [35, 0.267582672], [40, 0.280099207], [45, 0.298995517], [50, 0.31339335], [75, 0.38382068], [100, 0.466947757], [125, 0.567077868], [150, 0.669457289], [175, 0.783600527], [200, 0.906557961], [225, 1.034795807], [250, 1.223880454], [275, 1.483236588], [300, 1.446762611], [325, 2.871660511], [350, 1.88899637], [375, 2.208974247], [400, 3.502531384]] 12 | }, { 13 | "name": "fusion::vector", 14 | "data": [[0, 0.532285798], [5, 0.587629703], [10, 0.637663777], [15, 0.809419117], [20, 0.754429905], [25, 0.814558023], [30, 0.922002013], [35, 0.938531132], [40, 1.222406432], [45, 1.191773172], [50, 1.552619785]] 15 | }, { 16 | "name": "fusion::list", 17 | "data": [[0, 0.541007574], [5, 0.591942785], [10, 0.927009509], [15, 0.721025137], [20, 0.781671852], [25, 0.837740945], [30, 1.175594288], [35, 1.192285489], [40, 1.519120632], [45, 1.657798368], [50, 1.421118185]] 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /hana-cppnow-2015.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "path": "." 6 | } 7 | ], 8 | "build_systems": 9 | [ 10 | { 11 | "name": "Build index.html", 12 | "cmd": ["make", "index"], 13 | "working_dir": "$project_path/build" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /js/chart.js: -------------------------------------------------------------------------------- 1 | /* 2 | @copyright Louis Dionne 2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 5 | */ 6 | 7 | (function() { 8 | 'use strict'; 9 | 10 | var Hana = {}; 11 | Hana.initChart = function(div, options) { 12 | if (options.xAxis == undefined) { 13 | options.xAxis = { 14 | title: { text: "Number of elements" }, 15 | minTickInterval: 1 16 | }; 17 | } 18 | 19 | if (options.yAxis == undefined) { 20 | options.yAxis = { 21 | title: { text: "Time (s)" }, 22 | floor: 0 23 | }; 24 | } 25 | 26 | if (options.chart == undefined) { 27 | options.chart = { zoomType: 'xy' }; 28 | } 29 | 30 | if (options.title.x == undefined) { 31 | options.title.x = -20; // center 32 | } 33 | 34 | if (options.series.stickyTracking == undefined) { 35 | options.series.stickyTracking = false; 36 | } 37 | 38 | options.tooltip = options.tooltip || {}; 39 | options.tooltip.valueSuffix = options.tooltip.valueSuffix || 's'; 40 | 41 | if (options.legend == undefined) { 42 | options.legend = { 43 | layout: 'vertical', 44 | align: 'right', 45 | verticalAlign: 'middle', 46 | borderWidth: 0 47 | }; 48 | } 49 | div.highcharts(options); 50 | }; 51 | 52 | window.Hana = Hana; 53 | })(); 54 | -------------------------------------------------------------------------------- /lib/css/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | .hljs { 9 | display: block; padding: 0.5em; 10 | background: #3F3F3F; 11 | color: #DCDCDC; 12 | } 13 | 14 | .hljs-keyword, 15 | .hljs-tag, 16 | .css .hljs-class, 17 | .css .hljs-id, 18 | .lisp .hljs-title, 19 | .nginx .hljs-title, 20 | .hljs-request, 21 | .hljs-status, 22 | .clojure .hljs-attribute { 23 | color: #E3CEAB; 24 | } 25 | 26 | .django .hljs-template_tag, 27 | .django .hljs-variable, 28 | .django .hljs-filter .hljs-argument { 29 | color: #DCDCDC; 30 | } 31 | 32 | .hljs-number, 33 | .hljs-date { 34 | color: #8CD0D3; 35 | } 36 | 37 | .dos .hljs-envvar, 38 | .dos .hljs-stream, 39 | .hljs-variable, 40 | .apache .hljs-sqbracket { 41 | color: #EFDCBC; 42 | } 43 | 44 | .dos .hljs-flow, 45 | .diff .hljs-change, 46 | .python .exception, 47 | .python .hljs-built_in, 48 | .hljs-literal, 49 | .tex .hljs-special { 50 | color: #EFEFAF; 51 | } 52 | 53 | .diff .hljs-chunk, 54 | .hljs-subst { 55 | color: #8F8F8F; 56 | } 57 | 58 | .dos .hljs-keyword, 59 | .python .hljs-decorator, 60 | .hljs-title, 61 | .haskell .hljs-type, 62 | .diff .hljs-header, 63 | .ruby .hljs-class .hljs-parent, 64 | .apache .hljs-tag, 65 | .nginx .hljs-built_in, 66 | .tex .hljs-command, 67 | .hljs-prompt { 68 | color: #efef8f; 69 | } 70 | 71 | .dos .hljs-winutils, 72 | .ruby .hljs-symbol, 73 | .ruby .hljs-symbol .hljs-string, 74 | .ruby .hljs-string { 75 | color: #DCA3A3; 76 | } 77 | 78 | .diff .hljs-deletion, 79 | .hljs-string, 80 | .hljs-tag .hljs-value, 81 | .hljs-preprocessor, 82 | .hljs-pragma, 83 | .hljs-built_in, 84 | .sql .hljs-aggregate, 85 | .hljs-javadoc, 86 | .smalltalk .hljs-class, 87 | .smalltalk .hljs-localvars, 88 | .smalltalk .hljs-array, 89 | .css .hljs-rules .hljs-value, 90 | .hljs-attr_selector, 91 | .hljs-pseudo, 92 | .apache .hljs-cbracket, 93 | .tex .hljs-formula, 94 | .coffeescript .hljs-attribute { 95 | color: #CC9393; 96 | } 97 | 98 | .hljs-shebang, 99 | .diff .hljs-addition, 100 | .hljs-comment, 101 | .java .hljs-annotation, 102 | .hljs-template_comment, 103 | .hljs-pi, 104 | .hljs-doctype { 105 | color: #7F9F7F; 106 | } 107 | 108 | .coffeescript .javascript, 109 | .javascript .xml, 110 | .tex .hljs-formula, 111 | .xml .javascript, 112 | .xml .vbscript, 113 | .xml .css, 114 | .xml .hljs-cdata { 115 | opacity: 0.5; 116 | } 117 | 118 | -------------------------------------------------------------------------------- /lib/font/league-gothic/LICENSE: -------------------------------------------------------------------------------- 1 | SIL Open Font License (OFL) 2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | -------------------------------------------------------------------------------- /lib/font/league-gothic/league-gothic.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'League Gothic'; 3 | src: url('league-gothic.eot'); 4 | src: url('league-gothic.eot?#iefix') format('embedded-opentype'), 5 | url('league-gothic.woff') format('woff'), 6 | url('league-gothic.ttf') format('truetype'); 7 | 8 | font-weight: normal; 9 | font-style: normal; 10 | } -------------------------------------------------------------------------------- /lib/font/league-gothic/league-gothic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/league-gothic/league-gothic.eot -------------------------------------------------------------------------------- /lib/font/league-gothic/league-gothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/league-gothic/league-gothic.ttf -------------------------------------------------------------------------------- /lib/font/league-gothic/league-gothic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/league-gothic/league-gothic.woff -------------------------------------------------------------------------------- /lib/font/source-sans-pro/LICENSE: -------------------------------------------------------------------------------- 1 | SIL Open Font License 2 | 3 | Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. 4 | 5 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 6 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 7 | 8 | —————————————————————————————- 9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 10 | —————————————————————————————- 11 | 12 | PREAMBLE 13 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 14 | 15 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 16 | 17 | DEFINITIONS 18 | “Font Software” refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 19 | 20 | “Reserved Font Name” refers to any names specified as such after the copyright statement(s). 21 | 22 | “Original Version” refers to the collection of Font Software components as distributed by the Copyright Holder(s). 23 | 24 | “Modified Version” refers to any derivative made by adding to, deleting, or substituting—in part or in whole—any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 25 | 26 | “Author” refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 27 | 28 | PERMISSION & CONDITIONS 29 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 30 | 31 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 32 | 33 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 34 | 35 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 36 | 37 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 38 | 39 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 40 | 41 | TERMINATION 42 | This license becomes null and void if any of the above conditions are not met. 43 | 44 | DISCLAIMER 45 | THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-italic.eot -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-italic.ttf -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-italic.woff -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-regular.eot -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-regular.ttf -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-regular.woff -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-semibold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-semibold.eot -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-semibold.ttf -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-semibold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-semibold.woff -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff -------------------------------------------------------------------------------- /lib/font/source-sans-pro/source-sans-pro.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Source Sans Pro'; 3 | src: url('source-sans-pro-regular.eot'); 4 | src: url('source-sans-pro-regular.eot?#iefix') format('embedded-opentype'), 5 | url('source-sans-pro-regular.woff') format('woff'), 6 | url('source-sans-pro-regular.ttf') format('truetype'); 7 | font-weight: normal; 8 | font-style: normal; 9 | } 10 | 11 | @font-face { 12 | font-family: 'Source Sans Pro'; 13 | src: url('source-sans-pro-italic.eot'); 14 | src: url('source-sans-pro-italic.eot?#iefix') format('embedded-opentype'), 15 | url('source-sans-pro-italic.woff') format('woff'), 16 | url('source-sans-pro-italic.ttf') format('truetype'); 17 | font-weight: normal; 18 | font-style: italic; 19 | } 20 | 21 | @font-face { 22 | font-family: 'Source Sans Pro'; 23 | src: url('source-sans-pro-semibold.eot'); 24 | src: url('source-sans-pro-semibold.eot?#iefix') format('embedded-opentype'), 25 | url('source-sans-pro-semibold.woff') format('woff'), 26 | url('source-sans-pro-semibold.ttf') format('truetype'); 27 | font-weight: 600; 28 | font-style: normal; 29 | } 30 | 31 | @font-face { 32 | font-family: 'Source Sans Pro'; 33 | src: url('source-sans-pro-semibolditalic.eot'); 34 | src: url('source-sans-pro-semibolditalic.eot?#iefix') format('embedded-opentype'), 35 | url('source-sans-pro-semibolditalic.woff') format('woff'), 36 | url('source-sans-pro-semibolditalic.ttf') format('truetype'); 37 | font-weight: 600; 38 | font-style: italic; 39 | } -------------------------------------------------------------------------------- /lib/js/classList.js: -------------------------------------------------------------------------------- 1 | /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ 2 | if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p 3 | Copyright Tero Piirainen (tipiirai) 4 | License MIT / http://bit.ly/mit-license 5 | Version 0.96 6 | 7 | http://headjs.com 8 | */(function(a){function z(){d||(d=!0,s(e,function(a){p(a)}))}function y(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.async=!1,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.done=!0,d())},(a.body||b).appendChild(e)}function x(a,b){if(a.state==o)return b&&b();if(a.state==n)return k.ready(a.name,b);if(a.state==m)return a.onpreload.push(function(){x(a,b)});a.state=n,y(a.url,function(){a.state=o,b&&b(),s(g[a.name],function(a){p(a)}),u()&&d&&s(g.ALL,function(a){p(a)})})}function w(a,b){a.state===undefined&&(a.state=m,a.onpreload=[],y({src:a.url,type:"cache"},function(){v(a)}))}function v(a){a.state=l,s(a.onpreload,function(a){a.call()})}function u(a){a=a||h;var b;for(var c in a){if(a.hasOwnProperty(c)&&a[c].state!=o)return!1;b=!0}return b}function t(a){return Object.prototype.toString.call(a)=="[object Function]"}function s(a,b){if(!!a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Markdown Demo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 | 24 | 25 |
26 | 36 |
37 | 38 | 39 |
40 | 54 |
55 | 56 | 57 |
58 | 69 |
70 | 71 | 72 |
73 | 77 |
78 | 79 | 80 |
81 | 86 |
87 | 88 | 89 |
90 | 100 |
101 | 102 |
103 |
104 | 105 | 106 | 107 | 108 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /plugin/markdown/example.md: -------------------------------------------------------------------------------- 1 | # Markdown Demo 2 | 3 | 4 | 5 | ## External 1.1 6 | 7 | Content 1.1 8 | 9 | Note: This will only appear in the speaker notes window. 10 | 11 | 12 | ## External 1.2 13 | 14 | Content 1.2 15 | 16 | 17 | 18 | ## External 2 19 | 20 | Content 2.1 21 | 22 | 23 | 24 | ## External 3.1 25 | 26 | Content 3.1 27 | 28 | 29 | ## External 3.2 30 | 31 | Content 3.2 32 | -------------------------------------------------------------------------------- /plugin/math/math.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A plugin which enables rendering of math equations inside 3 | * of reveal.js slides. Essentially a thin wrapper for MathJax. 4 | * 5 | * @author Hakim El Hattab 6 | */ 7 | var RevealMath = window.RevealMath || (function(){ 8 | 9 | var options = Reveal.getConfig().math || {}; 10 | options.mathjax = options.mathjax || 'http://cdn.mathjax.org/mathjax/latest/MathJax.js'; 11 | options.config = options.config || 'TeX-AMS-MML_SVG-full'; 12 | 13 | loadScript( options.mathjax + '?config=' + options.config, function() { 14 | 15 | MathJax.Hub.Config({ 16 | messageStyle: 'none', 17 | tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }, 18 | skipStartupTypeset: true 19 | }); 20 | 21 | // Typeset followed by an immediate reveal.js layout since 22 | // the typesetting process could affect slide height 23 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub ] ); 24 | MathJax.Hub.Queue( Reveal.layout ); 25 | 26 | // Reprocess equations in slides when they turn visible 27 | Reveal.addEventListener( 'slidechanged', function( event ) { 28 | 29 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub, event.currentSlide ] ); 30 | 31 | } ); 32 | 33 | } ); 34 | 35 | function loadScript( url, callback ) { 36 | 37 | var head = document.querySelector( 'head' ); 38 | var script = document.createElement( 'script' ); 39 | script.type = 'text/javascript'; 40 | script.src = url; 41 | 42 | // Wrapper for callback to make sure it only fires once 43 | var finish = function() { 44 | if( typeof callback === 'function' ) { 45 | callback.call(); 46 | callback = null; 47 | } 48 | } 49 | 50 | script.onload = finish; 51 | 52 | // IE 53 | script.onreadystatechange = function() { 54 | if ( this.readyState === 'loaded' ) { 55 | finish(); 56 | } 57 | } 58 | 59 | // Normal browsers 60 | head.appendChild( script ); 61 | 62 | } 63 | 64 | })(); 65 | -------------------------------------------------------------------------------- /plugin/multiplex/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var multiplex = Reveal.getConfig().multiplex; 3 | var socketId = multiplex.id; 4 | var socket = io.connect(multiplex.url); 5 | 6 | socket.on(multiplex.id, function(data) { 7 | // ignore data from sockets that aren't ours 8 | if (data.socketId !== socketId) { return; } 9 | if( window.location.host === 'localhost:1947' ) return; 10 | 11 | Reveal.slide(data.indexh, data.indexv, data.indexf, 'remote'); 12 | }); 13 | }()); 14 | -------------------------------------------------------------------------------- /plugin/multiplex/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var fs = require('fs'); 3 | var io = require('socket.io'); 4 | var crypto = require('crypto'); 5 | 6 | var app = express.createServer(); 7 | var staticDir = express.static; 8 | 9 | io = io.listen(app); 10 | 11 | var opts = { 12 | port: 1948, 13 | baseDir : __dirname + '/../../' 14 | }; 15 | 16 | io.sockets.on('connection', function(socket) { 17 | socket.on('slidechanged', function(slideData) { 18 | if (typeof slideData.secret == 'undefined' || slideData.secret == null || slideData.secret === '') return; 19 | if (createHash(slideData.secret) === slideData.socketId) { 20 | slideData.secret = null; 21 | socket.broadcast.emit(slideData.socketId, slideData); 22 | }; 23 | }); 24 | }); 25 | 26 | app.configure(function() { 27 | [ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) { 28 | app.use('/' + dir, staticDir(opts.baseDir + dir)); 29 | }); 30 | }); 31 | 32 | app.get("/", function(req, res) { 33 | res.writeHead(200, {'Content-Type': 'text/html'}); 34 | fs.createReadStream(opts.baseDir + '/index.html').pipe(res); 35 | }); 36 | 37 | app.get("/token", function(req,res) { 38 | var ts = new Date().getTime(); 39 | var rand = Math.floor(Math.random()*9999999); 40 | var secret = ts.toString() + rand.toString(); 41 | res.send({secret: secret, socketId: createHash(secret)}); 42 | }); 43 | 44 | var createHash = function(secret) { 45 | var cipher = crypto.createCipher('blowfish', secret); 46 | return(cipher.final('hex')); 47 | }; 48 | 49 | // Actually listen 50 | app.listen(opts.port || null); 51 | 52 | var brown = '\033[33m', 53 | green = '\033[32m', 54 | reset = '\033[0m'; 55 | 56 | console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset ); -------------------------------------------------------------------------------- /plugin/multiplex/master.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // Don't emit events from inside of notes windows 3 | if ( window.location.search.match( /receiver/gi ) ) { return; } 4 | 5 | var multiplex = Reveal.getConfig().multiplex; 6 | 7 | var socket = io.connect(multiplex.url); 8 | 9 | var notify = function( slideElement, indexh, indexv, origin ) { 10 | if( typeof origin === 'undefined' && origin !== 'remote' ) { 11 | var nextindexh; 12 | var nextindexv; 13 | 14 | var fragmentindex = Reveal.getIndices().f; 15 | if (typeof fragmentindex == 'undefined') { 16 | fragmentindex = 0; 17 | } 18 | 19 | if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { 20 | nextindexh = indexh; 21 | nextindexv = indexv + 1; 22 | } else { 23 | nextindexh = indexh + 1; 24 | nextindexv = 0; 25 | } 26 | 27 | var slideData = { 28 | indexh : indexh, 29 | indexv : indexv, 30 | indexf : fragmentindex, 31 | nextindexh : nextindexh, 32 | nextindexv : nextindexv, 33 | secret: multiplex.secret, 34 | socketId : multiplex.id 35 | }; 36 | 37 | socket.emit('slidechanged', slideData); 38 | } 39 | } 40 | 41 | Reveal.addEventListener( 'slidechanged', function( event ) { 42 | notify( event.currentSlide, event.indexh, event.indexv, event.origin ); 43 | } ); 44 | 45 | var fragmentNotify = function( event ) { 46 | notify( Reveal.getCurrentSlide(), Reveal.getIndices().h, Reveal.getIndices().v, event.origin ); 47 | }; 48 | 49 | Reveal.addEventListener( 'fragmentshown', fragmentNotify ); 50 | Reveal.addEventListener( 'fragmenthidden', fragmentNotify ); 51 | }()); -------------------------------------------------------------------------------- /plugin/notes-server/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | // don't emit events from inside the previews themselves 4 | if( window.location.search.match( /receiver/gi ) ) { return; } 5 | 6 | var socket = io.connect( window.location.origin ), 7 | socketId = Math.random().toString().slice( 2 ); 8 | 9 | console.log( 'View slide notes at ' + window.location.origin + '/notes/' + socketId ); 10 | 11 | window.open( window.location.origin + '/notes/' + socketId, 'notes-' + socketId ); 12 | 13 | /** 14 | * Posts the current slide data to the notes window 15 | */ 16 | function post() { 17 | 18 | var slideElement = Reveal.getCurrentSlide(), 19 | notesElement = slideElement.querySelector( 'aside.notes' ); 20 | 21 | var messageData = { 22 | notes: '', 23 | markdown: false, 24 | socketId: socketId, 25 | state: Reveal.getState() 26 | }; 27 | 28 | // Look for notes defined in a slide attribute 29 | if( slideElement.hasAttribute( 'data-notes' ) ) { 30 | messageData.notes = slideElement.getAttribute( 'data-notes' ); 31 | } 32 | 33 | // Look for notes defined in an aside element 34 | if( notesElement ) { 35 | messageData.notes = notesElement.innerHTML; 36 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string'; 37 | } 38 | 39 | socket.emit( 'statechanged', messageData ); 40 | 41 | } 42 | 43 | // When a new notes window connects, post our current state 44 | socket.on( 'connect', function( data ) { 45 | post(); 46 | } ); 47 | 48 | // Monitor events that trigger a change in state 49 | Reveal.addEventListener( 'slidechanged', post ); 50 | Reveal.addEventListener( 'fragmentshown', post ); 51 | Reveal.addEventListener( 'fragmenthidden', post ); 52 | Reveal.addEventListener( 'overviewhidden', post ); 53 | Reveal.addEventListener( 'overviewshown', post ); 54 | Reveal.addEventListener( 'paused', post ); 55 | Reveal.addEventListener( 'resumed', post ); 56 | 57 | // Post the initial state 58 | post(); 59 | 60 | }()); 61 | -------------------------------------------------------------------------------- /plugin/notes-server/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var fs = require('fs'); 3 | var io = require('socket.io'); 4 | var _ = require('underscore'); 5 | var Mustache = require('mustache'); 6 | 7 | var app = express.createServer(); 8 | var staticDir = express.static; 9 | 10 | io = io.listen(app); 11 | 12 | var opts = { 13 | port : 1947, 14 | baseDir : __dirname + '/../../' 15 | }; 16 | 17 | io.sockets.on( 'connection', function( socket ) { 18 | 19 | socket.on( 'connect', function( data ) { 20 | socket.broadcast.emit( 'connect', data ); 21 | }); 22 | 23 | socket.on( 'statechanged', function( data ) { 24 | socket.broadcast.emit( 'statechanged', data ); 25 | }); 26 | 27 | }); 28 | 29 | app.configure( function() { 30 | 31 | [ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) { 32 | app.use( '/' + dir, staticDir( opts.baseDir + dir ) ); 33 | }); 34 | 35 | }); 36 | 37 | app.get('/', function( req, res ) { 38 | 39 | res.writeHead( 200, { 'Content-Type': 'text/html' } ); 40 | fs.createReadStream( opts.baseDir + '/index.html' ).pipe( res ); 41 | 42 | }); 43 | 44 | app.get( '/notes/:socketId', function( req, res ) { 45 | 46 | fs.readFile( opts.baseDir + 'plugin/notes-server/notes.html', function( err, data ) { 47 | res.send( Mustache.to_html( data.toString(), { 48 | socketId : req.params.socketId 49 | })); 50 | }); 51 | 52 | }); 53 | 54 | // Actually listen 55 | app.listen( opts.port || null ); 56 | 57 | var brown = '\033[33m', 58 | green = '\033[32m', 59 | reset = '\033[0m'; 60 | 61 | var slidesLocation = 'http://localhost' + ( opts.port ? ( ':' + opts.port ) : '' ); 62 | 63 | console.log( brown + 'reveal.js - Speaker Notes' + reset ); 64 | console.log( '1. Open the slides at ' + green + slidesLocation + reset ); 65 | console.log( '2. Click on the link your JS console to go to the notes page' ); 66 | console.log( '3. Advance through your slides and your notes will advance automatically' ); 67 | -------------------------------------------------------------------------------- /plugin/notes/notes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles opening of and synchronization with the reveal.js 3 | * notes window. 4 | * 5 | * Handshake process: 6 | * 1. This window posts 'connect' to notes window 7 | * - Includes URL of presentation to show 8 | * 2. Notes window responds with 'connected' when it is available 9 | * 3. This window proceeds to send the current presentation state 10 | * to the notes window 11 | */ 12 | var RevealNotes = (function() { 13 | 14 | function openNotes() { 15 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path 16 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path 17 | var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1100,height=700' ); 18 | 19 | /** 20 | * Connect to the notes window through a postmessage handshake. 21 | * Using postmessage enables us to work in situations where the 22 | * origins differ, such as a presentation being opened from the 23 | * file system. 24 | */ 25 | function connect() { 26 | // Keep trying to connect until we get a 'connected' message back 27 | var connectInterval = setInterval( function() { 28 | notesPopup.postMessage( JSON.stringify( { 29 | namespace: 'reveal-notes', 30 | type: 'connect', 31 | url: window.location.protocol + '//' + window.location.host + window.location.pathname, 32 | state: Reveal.getState() 33 | } ), '*' ); 34 | }, 500 ); 35 | 36 | window.addEventListener( 'message', function( event ) { 37 | var data = JSON.parse( event.data ); 38 | if( data && data.namespace === 'reveal-notes' && data.type === 'connected' ) { 39 | clearInterval( connectInterval ); 40 | onConnected(); 41 | } 42 | } ); 43 | } 44 | 45 | /** 46 | * Posts the current slide data to the notes window 47 | */ 48 | function post() { 49 | 50 | var slideElement = Reveal.getCurrentSlide(), 51 | notesElement = slideElement.querySelector( 'aside.notes' ); 52 | 53 | var messageData = { 54 | namespace: 'reveal-notes', 55 | type: 'state', 56 | notes: '', 57 | markdown: false, 58 | state: Reveal.getState() 59 | }; 60 | 61 | // Look for notes defined in a slide attribute 62 | if( slideElement.hasAttribute( 'data-notes' ) ) { 63 | messageData.notes = slideElement.getAttribute( 'data-notes' ); 64 | } 65 | 66 | // Look for notes defined in an aside element 67 | if( notesElement ) { 68 | messageData.notes = notesElement.innerHTML; 69 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string'; 70 | } 71 | 72 | notesPopup.postMessage( JSON.stringify( messageData ), '*' ); 73 | 74 | } 75 | 76 | /** 77 | * Called once we have established a connection to the notes 78 | * window. 79 | */ 80 | function onConnected() { 81 | 82 | // Monitor events that trigger a change in state 83 | Reveal.addEventListener( 'slidechanged', post ); 84 | Reveal.addEventListener( 'fragmentshown', post ); 85 | Reveal.addEventListener( 'fragmenthidden', post ); 86 | Reveal.addEventListener( 'overviewhidden', post ); 87 | Reveal.addEventListener( 'overviewshown', post ); 88 | Reveal.addEventListener( 'paused', post ); 89 | Reveal.addEventListener( 'resumed', post ); 90 | 91 | // Post the initial state 92 | post(); 93 | 94 | } 95 | 96 | connect(); 97 | } 98 | 99 | if( !/receiver/i.test( window.location.search ) ) { 100 | 101 | // If the there's a 'notes' query set, open directly 102 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { 103 | openNotes(); 104 | } 105 | 106 | // Open the notes when the 's' key is hit 107 | document.addEventListener( 'keydown', function( event ) { 108 | // Disregard the event if the target is editable or a 109 | // modifier is present 110 | if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; 111 | 112 | if( event.keyCode === 83 ) { 113 | event.preventDefault(); 114 | openNotes(); 115 | } 116 | }, false ); 117 | 118 | } 119 | 120 | return { open: openNotes }; 121 | 122 | })(); 123 | -------------------------------------------------------------------------------- /plugin/print-pdf/print-pdf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * phantomjs script for printing presentations to PDF. 3 | * 4 | * Example: 5 | * phantomjs print-pdf.js "http://lab.hakim.se/reveal-js?print-pdf" reveal-demo.pdf 6 | * 7 | * By Manuel Bieh (https://github.com/manuelbieh) 8 | */ 9 | 10 | // html2pdf.js 11 | var page = new WebPage(); 12 | var system = require( 'system' ); 13 | 14 | var slideWidth = system.args[3] ? system.args[3].split( 'x' )[0] : 960; 15 | var slideHeight = system.args[3] ? system.args[3].split( 'x' )[1] : 700; 16 | 17 | page.viewportSize = { 18 | width: slideWidth, 19 | height: slideHeight 20 | }; 21 | 22 | // TODO 23 | // Something is wrong with these config values. An input 24 | // paper width of 1920px actually results in a 756px wide 25 | // PDF. 26 | page.paperSize = { 27 | width: Math.round( slideWidth * 2 ), 28 | height: Math.round( slideHeight * 2 ), 29 | border: 0 30 | }; 31 | 32 | var inputFile = system.args[1] || 'index.html?print-pdf'; 33 | var outputFile = system.args[2] || 'slides.pdf'; 34 | 35 | if( outputFile.match( /\.pdf$/gi ) === null ) { 36 | outputFile += '.pdf'; 37 | } 38 | 39 | console.log( 'Printing PDF (Paper size: '+ page.paperSize.width + 'x' + page.paperSize.height +')' ); 40 | 41 | page.open( inputFile, function( status ) { 42 | window.setTimeout( function() { 43 | console.log( 'Printed succesfully' ); 44 | page.render( outputFile ); 45 | phantom.exit(); 46 | }, 1000 ); 47 | } ); 48 | 49 | -------------------------------------------------------------------------------- /plugin/remotes/remotes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Touch-based remote controller for your presentation courtesy 3 | * of the folks at http://remotes.io 4 | */ 5 | 6 | (function(window){ 7 | 8 | /** 9 | * Detects if we are dealing with a touch enabled device (with some false positives) 10 | * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js 11 | */ 12 | var hasTouch = (function(){ 13 | return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; 14 | })(); 15 | 16 | /** 17 | * Detects if notes are enable and the current page is opened inside an /iframe 18 | * this prevents loading Remotes.io several times 19 | */ 20 | var isNotesAndIframe = (function(){ 21 | return window.RevealNotes && !(self == top); 22 | })(); 23 | 24 | if(!hasTouch && !isNotesAndIframe){ 25 | head.ready( 'remotes.ne.min.js', function() { 26 | new Remotes("preview") 27 | .on("swipe-left", function(e){ Reveal.right(); }) 28 | .on("swipe-right", function(e){ Reveal.left(); }) 29 | .on("swipe-up", function(e){ Reveal.down(); }) 30 | .on("swipe-down", function(e){ Reveal.up(); }) 31 | .on("tap", function(e){ Reveal.next(); }) 32 | .on("zoom-out", function(e){ Reveal.toggleOverview(true); }) 33 | .on("zoom-in", function(e){ Reveal.toggleOverview(false); }) 34 | ; 35 | } ); 36 | 37 | head.js('https://hakim-static.s3.amazonaws.com/reveal-js/remotes.ne.min.js'); 38 | } 39 | })(window); -------------------------------------------------------------------------------- /sampler/file_utils.hpp: -------------------------------------------------------------------------------- 1 | // Copied from 2 | // http://github.com/tzlaine/type_erasure 3 | // 4 | // All credits to Zach Laine. 5 | 6 | #ifndef FILE_UTILS_INCLUDED__ 7 | #define FILE_UTILS_INCLUDED__ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | inline std::string file_slurp (const std::string & filename) 15 | { 16 | std::string retval; 17 | 18 | std::ifstream ifs(filename, std::ifstream::in | std::ifstream::binary); 19 | ifs.seekg(0, std::ifstream::end); 20 | if (0 < ifs.tellg()) 21 | retval.resize(ifs.tellg()); 22 | ifs.seekg(0); 23 | 24 | const std::streamsize read_size = 64 * 1024; // 64k per read 25 | char* retval_pos = &retval[0]; 26 | std::streamsize bytes_read = 0; 27 | do { 28 | ifs.read(retval_pos, read_size); 29 | bytes_read = ifs.gcount(); 30 | retval_pos += bytes_read; 31 | } while (bytes_read == read_size); 32 | 33 | return retval; 34 | } 35 | 36 | inline std::vector line_break (const std::string & file) 37 | { 38 | std::vector retval; 39 | 40 | std::string::size_type prev_pos = 0; 41 | while (true) { 42 | std::string::size_type pos = file.find('\n', prev_pos); 43 | if (pos == std::string::npos) 44 | break; 45 | retval.push_back(file.substr(prev_pos, pos - prev_pos)); 46 | prev_pos = pos + 1; 47 | } 48 | 49 | retval.push_back(file.substr(prev_pos)); 50 | 51 | return retval; 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /sampler/sampler.cpp: -------------------------------------------------------------------------------- 1 | // Copied from 2 | // http://github.com/tzlaine/type_erasure 3 | // 4 | // All credits to Zach Laine. 5 | 6 | #include "file_utils.hpp" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | void find_samples (const std::vector & lines, 15 | std::map & samples) 16 | { 17 | const std::string sample_str = "sample"; 18 | const std::string end_str = "end-sample"; 19 | 20 | std::string current_sample_name; 21 | for (const std::string & line : lines) { 22 | const bool comment_line = line.find("//") == 0; 23 | std::string::size_type sample_pos = line.find(sample_str); 24 | std::string::size_type end_pos = line.find(end_str); 25 | if (comment_line && end_pos != std::string::npos) { 26 | samples[current_sample_name] += "```"; 27 | current_sample_name = ""; 28 | } else if (comment_line && sample_pos != std::string::npos) { 29 | sample_pos += sample_str.size() + 1; 30 | std::string::size_type close_paren = line.find(")", sample_pos); 31 | current_sample_name = 32 | line.substr(sample_pos, close_paren - sample_pos); 33 | std::string::size_type size_minus_3 = 34 | samples[current_sample_name].size() - 3; 35 | if (samples[current_sample_name].rfind("```") == size_minus_3) { 36 | samples[current_sample_name].resize( 37 | samples[current_sample_name].size() - 3 38 | ); 39 | } else { 40 | samples[current_sample_name] += "```cpp\n"; 41 | } 42 | } else if (current_sample_name != "") { 43 | samples[current_sample_name] += line + '\n'; 44 | } 45 | } 46 | } 47 | 48 | 49 | int main (int argc, char * argv[]) 50 | { 51 | assert(3 <= argc); 52 | 53 | const char * in_filename = argv[1]; 54 | 55 | std::vector file_lines = line_break(file_slurp(in_filename)); 56 | 57 | std::map samples; 58 | std::for_each(argv + 3, argv + argc, 59 | [&](const char * filename) { 60 | find_samples(line_break(file_slurp(filename)), samples); 61 | }); 62 | 63 | for (std::string & line : file_lines) { 64 | std::string::size_type sample_ref_pos = line.find("%%"); 65 | if (sample_ref_pos != std::string::npos) { 66 | sample_ref_pos += 2; 67 | std::string::size_type sample_ref_end_pos = 68 | line.find("%%", sample_ref_pos); 69 | const std::string sample_name = line.substr( 70 | sample_ref_pos, 71 | sample_ref_end_pos - sample_ref_pos 72 | ); 73 | line = samples[sample_name]; 74 | } 75 | } 76 | 77 | const char * out_filename = argv[2]; 78 | std::ofstream ofs(out_filename); 79 | for (const std::string & line : file_lines) { 80 | ofs << line << "\n"; 81 | } 82 | 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /test/examples/assets/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/test/examples/assets/image1.png -------------------------------------------------------------------------------- /test/examples/assets/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ldionne/cppnow-2015-hana/2f9e86996b61b11e19486741f59ef217ea9125a7/test/examples/assets/image2.png -------------------------------------------------------------------------------- /test/examples/barebones.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Barebones 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 18 |
19 |

Barebones Presentation

20 |

This example contains the bare minimum includes and markup required to run a reveal.js presentation.

21 |
22 | 23 |
24 |

No Theme

25 |

There's no theme included, so it will fall back on browser defaults.

26 |
27 | 28 |
29 | 30 |
31 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test/examples/embedded-media.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Embedded Media 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |

Embedded Media Test

23 |
24 | 25 |
26 | 27 |
28 | 29 |
30 |

Empty Slide

31 |
32 | 33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/examples/math.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Math Plugin 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |

reveal.js Math Plugin

23 |

A thin wrapper for MathJax

24 |
25 | 26 |
27 |

The Lorenz Equations

28 | 29 | \[\begin{aligned} 30 | \dot{x} & = \sigma(y-x) \\ 31 | \dot{y} & = \rho x - y - xz \\ 32 | \dot{z} & = -\beta z + xy 33 | \end{aligned} \] 34 |
35 | 36 |
37 |

The Cauchy-Schwarz Inequality

38 | 39 | 42 |
43 | 44 |
45 |

A Cross Product Formula

46 | 47 | \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} 48 | \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 49 | \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ 50 | \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 51 | \end{vmatrix} \] 52 |
53 | 54 |
55 |

The probability of getting \(k\) heads when flipping \(n\) coins is

56 | 57 | \[P(E) = {n \choose k} p^k (1-p)^{ n-k} \] 58 |
59 | 60 |
61 |

An Identity of Ramanujan

62 | 63 | \[ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 64 | 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} 65 | {1+\frac{e^{-8\pi}} {1+\ldots} } } } \] 66 |
67 | 68 |
69 |

A Rogers-Ramanujan Identity

70 | 71 | \[ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = 72 | \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}\] 73 |
74 | 75 |
76 |

Maxwell’s Equations

77 | 78 | \[ \begin{aligned} 79 | \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ 80 | \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ 81 | \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} 82 | \] 83 |
84 | 85 |
86 |
87 |

The Lorenz Equations

88 | 89 |
90 | \[\begin{aligned} 91 | \dot{x} & = \sigma(y-x) \\ 92 | \dot{y} & = \rho x - y - xz \\ 93 | \dot{z} & = -\beta z + xy 94 | \end{aligned} \] 95 |
96 |
97 | 98 |
99 |

The Cauchy-Schwarz Inequality

100 | 101 |
102 | \[ \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \] 103 |
104 |
105 | 106 |
107 |

A Cross Product Formula

108 | 109 |
110 | \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} 111 | \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 112 | \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ 113 | \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 114 | \end{vmatrix} \] 115 |
116 |
117 | 118 |
119 |

The probability of getting \(k\) heads when flipping \(n\) coins is

120 | 121 |
122 | \[P(E) = {n \choose k} p^k (1-p)^{ n-k} \] 123 |
124 |
125 | 126 |
127 |

An Identity of Ramanujan

128 | 129 |
130 | \[ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 131 | 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} 132 | {1+\frac{e^{-8\pi}} {1+\ldots} } } } \] 133 |
134 |
135 | 136 |
137 |

A Rogers-Ramanujan Identity

138 | 139 |
140 | \[ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = 141 | \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}\] 142 |
143 |
144 | 145 |
146 |

Maxwell’s Equations

147 | 148 |
149 | \[ \begin{aligned} 150 | \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ 151 | \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ 152 | \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} 153 | \] 154 |
155 |
156 |
157 | 158 |
159 | 160 |
161 | 162 | 163 | 164 | 165 | 183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /test/examples/slide-backgrounds.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Slide Backgrounds 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 |
32 |

data-background: #00ffff

33 |
34 | 35 |
36 |

data-background: #bb00bb

37 |
38 | 39 |
40 |

data-background: lightblue

41 |
42 | 43 |
44 |
45 |

data-background: #ff0000

46 |
47 |
48 |

data-background: rgba(0, 0, 0, 0.2)

49 |
50 |
51 |

data-background: salmon

52 |
53 |
54 | 55 |
56 |
57 |

Background applied to stack

58 |
59 |
60 |

Background applied to stack

61 |
62 |
63 |

Background applied to slide inside of stack

64 |
65 |
66 | 67 |
68 |

Background image

69 |
70 | 71 |
72 |
73 |

Background image

74 |
75 |
76 |

Background image

77 |
78 |
79 | 80 |
81 |

Background image

82 |
data-background-size="100px" data-background-repeat="repeat" data-background-color="#111"
83 |
84 | 85 |
86 |

Same background twice (1/2)

87 |
88 |
89 |

Same background twice (2/2)

90 |
91 | 92 |
93 |

Video background

94 |
95 | 96 |
97 |

Iframe background

98 |
99 | 100 |
101 |
102 |

Same background twice vertical (1/2)

103 |
104 |
105 |

Same background twice vertical (2/2)

106 |
107 |
108 | 109 |
110 |

Same background from horizontal to vertical (1/3)

111 |
112 |
113 |
114 |

Same background from horizontal to vertical (2/3)

115 |
116 |
117 |

Same background from horizontal to vertical (3/3)

118 |
119 |
120 | 121 |
122 | 123 |
124 | 125 | 126 | 127 | 128 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /test/qunit-1.12.0.css: -------------------------------------------------------------------------------- 1 | /** 2 | * QUnit v1.12.0 - A JavaScript Unit Testing Framework 3 | * 4 | * http://qunitjs.com 5 | * 6 | * Copyright 2012 jQuery Foundation and other contributors 7 | * Released under the MIT license. 8 | * http://jquery.org/license 9 | */ 10 | 11 | /** Font Family and Sizes */ 12 | 13 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { 14 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; 15 | } 16 | 17 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } 18 | #qunit-tests { font-size: smaller; } 19 | 20 | 21 | /** Resets */ 22 | 23 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { 24 | margin: 0; 25 | padding: 0; 26 | } 27 | 28 | 29 | /** Header */ 30 | 31 | #qunit-header { 32 | padding: 0.5em 0 0.5em 1em; 33 | 34 | color: #8699a4; 35 | background-color: #0d3349; 36 | 37 | font-size: 1.5em; 38 | line-height: 1em; 39 | font-weight: normal; 40 | 41 | border-radius: 5px 5px 0 0; 42 | -moz-border-radius: 5px 5px 0 0; 43 | -webkit-border-top-right-radius: 5px; 44 | -webkit-border-top-left-radius: 5px; 45 | } 46 | 47 | #qunit-header a { 48 | text-decoration: none; 49 | color: #c2ccd1; 50 | } 51 | 52 | #qunit-header a:hover, 53 | #qunit-header a:focus { 54 | color: #fff; 55 | } 56 | 57 | #qunit-testrunner-toolbar label { 58 | display: inline-block; 59 | padding: 0 .5em 0 .1em; 60 | } 61 | 62 | #qunit-banner { 63 | height: 5px; 64 | } 65 | 66 | #qunit-testrunner-toolbar { 67 | padding: 0.5em 0 0.5em 2em; 68 | color: #5E740B; 69 | background-color: #eee; 70 | overflow: hidden; 71 | } 72 | 73 | #qunit-userAgent { 74 | padding: 0.5em 0 0.5em 2.5em; 75 | background-color: #2b81af; 76 | color: #fff; 77 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; 78 | } 79 | 80 | #qunit-modulefilter-container { 81 | float: right; 82 | } 83 | 84 | /** Tests: Pass/Fail */ 85 | 86 | #qunit-tests { 87 | list-style-position: inside; 88 | } 89 | 90 | #qunit-tests li { 91 | padding: 0.4em 0.5em 0.4em 2.5em; 92 | border-bottom: 1px solid #fff; 93 | list-style-position: inside; 94 | } 95 | 96 | #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { 97 | display: none; 98 | } 99 | 100 | #qunit-tests li strong { 101 | cursor: pointer; 102 | } 103 | 104 | #qunit-tests li a { 105 | padding: 0.5em; 106 | color: #c2ccd1; 107 | text-decoration: none; 108 | } 109 | #qunit-tests li a:hover, 110 | #qunit-tests li a:focus { 111 | color: #000; 112 | } 113 | 114 | #qunit-tests li .runtime { 115 | float: right; 116 | font-size: smaller; 117 | } 118 | 119 | .qunit-assert-list { 120 | margin-top: 0.5em; 121 | padding: 0.5em; 122 | 123 | background-color: #fff; 124 | 125 | border-radius: 5px; 126 | -moz-border-radius: 5px; 127 | -webkit-border-radius: 5px; 128 | } 129 | 130 | .qunit-collapsed { 131 | display: none; 132 | } 133 | 134 | #qunit-tests table { 135 | border-collapse: collapse; 136 | margin-top: .2em; 137 | } 138 | 139 | #qunit-tests th { 140 | text-align: right; 141 | vertical-align: top; 142 | padding: 0 .5em 0 0; 143 | } 144 | 145 | #qunit-tests td { 146 | vertical-align: top; 147 | } 148 | 149 | #qunit-tests pre { 150 | margin: 0; 151 | white-space: pre-wrap; 152 | word-wrap: break-word; 153 | } 154 | 155 | #qunit-tests del { 156 | background-color: #e0f2be; 157 | color: #374e0c; 158 | text-decoration: none; 159 | } 160 | 161 | #qunit-tests ins { 162 | background-color: #ffcaca; 163 | color: #500; 164 | text-decoration: none; 165 | } 166 | 167 | /*** Test Counts */ 168 | 169 | #qunit-tests b.counts { color: black; } 170 | #qunit-tests b.passed { color: #5E740B; } 171 | #qunit-tests b.failed { color: #710909; } 172 | 173 | #qunit-tests li li { 174 | padding: 5px; 175 | background-color: #fff; 176 | border-bottom: none; 177 | list-style-position: inside; 178 | } 179 | 180 | /*** Passing Styles */ 181 | 182 | #qunit-tests li li.pass { 183 | color: #3c510c; 184 | background-color: #fff; 185 | border-left: 10px solid #C6E746; 186 | } 187 | 188 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } 189 | #qunit-tests .pass .test-name { color: #366097; } 190 | 191 | #qunit-tests .pass .test-actual, 192 | #qunit-tests .pass .test-expected { color: #999999; } 193 | 194 | #qunit-banner.qunit-pass { background-color: #C6E746; } 195 | 196 | /*** Failing Styles */ 197 | 198 | #qunit-tests li li.fail { 199 | color: #710909; 200 | background-color: #fff; 201 | border-left: 10px solid #EE5757; 202 | white-space: pre; 203 | } 204 | 205 | #qunit-tests > li:last-child { 206 | border-radius: 0 0 5px 5px; 207 | -moz-border-radius: 0 0 5px 5px; 208 | -webkit-border-bottom-right-radius: 5px; 209 | -webkit-border-bottom-left-radius: 5px; 210 | } 211 | 212 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } 213 | #qunit-tests .fail .test-name, 214 | #qunit-tests .fail .module-name { color: #000000; } 215 | 216 | #qunit-tests .fail .test-actual { color: #EE5757; } 217 | #qunit-tests .fail .test-expected { color: green; } 218 | 219 | #qunit-banner.qunit-fail { background-color: #EE5757; } 220 | 221 | 222 | /** Result */ 223 | 224 | #qunit-testresult { 225 | padding: 0.5em 0.5em 0.5em 2.5em; 226 | 227 | color: #2b81af; 228 | background-color: #D2E0E6; 229 | 230 | border-bottom: 1px solid white; 231 | } 232 | #qunit-testresult .module-name { 233 | font-weight: bold; 234 | } 235 | 236 | /** Fixture */ 237 | 238 | #qunit-fixture { 239 | position: absolute; 240 | top: -10000px; 241 | left: -10000px; 242 | width: 1000px; 243 | height: 1000px; 244 | } -------------------------------------------------------------------------------- /test/test-markdown-element-attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown Element Attributes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /test/test-markdown-element-attributes.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 4, 'found four slides' ); 9 | }); 10 | 11 | 12 | test( 'Attributes on element header in vertical slides', function() { 13 | strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.fade-out' ).length, 1, 'found one vertical slide with class fragment.fade-out on header' ); 14 | strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' ); 15 | }); 16 | 17 | test( 'Attributes on element paragraphs in vertical slides', function() { 18 | strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' ); 19 | }); 20 | 21 | test( 'Attributes on element list items in vertical slides', function() { 22 | strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.roll-in' ).length, 3, 'found a vertical slide with three list items with class fragment.roll-in' ); 23 | }); 24 | 25 | test( 'Attributes on element paragraphs in horizontal slides', function() { 26 | strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' ); 27 | }); 28 | test( 'Attributes on element list items in horizontal slides', function() { 29 | strictEqual( document.querySelectorAll( '.reveal .slides section li.fragment.highlight-green' ).length, 5, 'found a horizontal slide with five list items with class fragment.roll-in' ); 30 | }); 31 | test( 'Attributes on element list items in horizontal slides', function() { 32 | strictEqual( document.querySelectorAll( '.reveal .slides section img.reveal.stretch' ).length, 1, 'found a horizontal slide with stretched image, class img.reveal.stretch' ); 33 | }); 34 | 35 | test( 'Attributes on elements in vertical slides with default element attribute separator', function() { 36 | strictEqual( document.querySelectorAll( '.reveal .slides section h2.fragment.highlight-red' ).length, 2, 'found two h2 titles with fragment highlight-red in vertical slides with default element attribute separator' ); 37 | }); 38 | 39 | test( 'Attributes on elements in single slides with default element attribute separator', function() { 40 | strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-blue' ).length, 3, 'found three elements with fragment highlight-blue in single slide with default element attribute separator' ); 41 | }); 42 | 43 | } ); 44 | 45 | Reveal.initialize(); 46 | 47 | -------------------------------------------------------------------------------- /test/test-markdown-slide-attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown Attributes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /test/test-markdown-slide-attributes.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' ); 9 | }); 10 | 11 | test( 'Id on slide', function() { 12 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' ); 13 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' ); 14 | }); 15 | 16 | test( 'data-background attributes', function() { 17 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); 18 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); 19 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); 20 | }); 21 | 22 | test( 'data-transition attributes', function() { 23 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); 24 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); 25 | strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' ); 26 | }); 27 | 28 | test( 'data-background attributes with default separator', function() { 29 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); 30 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); 31 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); 32 | }); 33 | 34 | test( 'data-transition attributes with default separator', function() { 35 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); 36 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); 37 | strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' ); 38 | }); 39 | 40 | test( 'data-transition attributes with inline content', function() { 41 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#ff0000"]' ).length, 3, 'found three horizontal slides with data-background="#ff0000"' ); 42 | }); 43 | 44 | } ); 45 | 46 | Reveal.initialize(); 47 | 48 | -------------------------------------------------------------------------------- /test/test-markdown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /test/test-markdown.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' ); 9 | }); 10 | 11 | 12 | } ); 13 | 14 | Reveal.initialize(); 15 | 16 | -------------------------------------------------------------------------------- /test/test-pdf.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test PDF exports 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 | 19 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /test/test-pdf.js: -------------------------------------------------------------------------------- 1 | 2 | Reveal.addEventListener( 'ready', function() { 3 | 4 | // Only one test for now, we're mainly ensuring that there 5 | // are no execution errors when running PDF mode 6 | 7 | test( 'Reveal.isReady', function() { 8 | strictEqual( Reveal.isReady(), true, 'returns true' ); 9 | }); 10 | 11 | 12 | } ); 13 | 14 | Reveal.initialize({ pdf: true }); 15 | 16 | -------------------------------------------------------------------------------- /test/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Tests 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | --------------------------------------------------------------------------------