aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2019-01-04 14:34:43 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2019-01-04 14:34:43 +0100
commit0c82209bca885b0f9cd80ab4717e63b7dfa75cab (patch)
tree709647dcccb25459baa507aed7e0f491903d315c
parentAdd script to generate QtCreator project files (diff)
downloadsmolbote-0c82209bca885b0f9cd80ab4717e63b7dfa75cab.tar.xz
Add assorted unfished doc files to repo
-rw-r--r--.gitignore3
-rw-r--r--doc/Development/Hacking.asciidoc52
-rw-r--r--doc/images/browser-for-fun.pngbin0 -> 186244 bytes
-rw-r--r--doc/meson.build70
-rw-r--r--doc/smolbote.asciidoc22
-rw-r--r--linux/poi.fish11
-rw-r--r--meson.build6
7 files changed, 136 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 7551bc0..fd7fd1b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,8 +12,11 @@ build*
lang/*.qm
test/plugins.d
+.config
.config.old
+smolbote.*
+
# manpages
doc/smolbote.5
doc/smolbote.7
diff --git a/doc/Development/Hacking.asciidoc b/doc/Development/Hacking.asciidoc
new file mode 100644
index 0000000..d0332e9
--- /dev/null
+++ b/doc/Development/Hacking.asciidoc
@@ -0,0 +1,52 @@
+== C++ Performance
+(Adapted from CppCon2016 Practical Performance Practices)
+https://florianjw.de/en/cpp_coding_standard.html
+
+- Prefer std::array, then std::vector
+- Construct and initialize in one step
+- Use const always when possible
+- To enable const with complex initialization, use lambdas
+- Don't recalculate values that only need to be calculated once
+- Don't disable move operations - moving is more efficient than copying
+- Avoid shared_ptr copies unless really needed
+- Prefer returning unique_ptr from factories
+- Use '\n' instead of std::endl
+- Use lambdas - they have no overhead compared to direct functions
+- final can help the compiler optimize virtual function calls
+- Code branches are expensive
+
+=== Smaller code is faster code
+
+=== Do one thing and do it well
+Simple code is easy to understand, easy to maintain, and as such lead to less bugs.
+
+=== Only use text formats
+They can be edited both by humans and by programs. Use generic formats (ini, json, etc.) instead of custom ones.
+
+=== Document your changes
+Don't do this just for others, do it for your future self.
+
+== Useful compiler options
+- -fuse-ld=gold
+- -Wold-style-cast
+
+=== Setting in meson
+Compiler arguments are free-form comma-separated list.
+meson configure -Dcpp_args="-Wold-style-cast"
+meson configure -Dcpp_link_args="-fuse-ld=gold"
+
+== C++ Coding Standard
+
+=== Naming Conventions
+- Naming uses camelCase
+- Private attributes are prefixed with 'm_'.
+- Include guards should be named SMOLBOTE_<class name in caps>_H
+
+=== Compiler
+- Use the highest sane warning level.
+
+=== Resource management
+- Manage your resources with RAII (Resource Acquisition Is Initialization).
+
+=== Functions
+- Try to keep the complexity low and the body short.
diff --git a/doc/images/browser-for-fun.png b/doc/images/browser-for-fun.png
new file mode 100644
index 0000000..72d24e6
--- /dev/null
+++ b/doc/images/browser-for-fun.png
Binary files differ
diff --git a/doc/meson.build b/doc/meson.build
index d45aea1..868b8d5 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,28 +1,42 @@
-if get_option('manpage').enabled()
- asciidoctor = find_program('asciidoctor', required: true)
-
- custom_target('manpage',
- # list depend_files so the output can be updated if any of them are changed
- depend_files: ['smolbote.7.asciidoc', 'Usage/CommandLine.asciidoc', 'Usage/Configuration.asciidoc', 'Usage/Profile.asciidoc', 'Usage/Plugins.asciidoc', 'Usage/Filter.asciidoc'],
- input: 'smolbote.7.asciidoc',
- output: 'smolbote.7',
- command: [asciidoctor, '--backend=manpage', '--out-file=@OUTPUT@', '@INPUT@'],
- build_by_default: true,
- install: true, install_dir: join_paths(get_option('mandir'), 'man7')
- )
-
- custom_target('manpage.5',
- # list of files this target depends on
- depend_files: ['smolbote.5.asciidoc'],
-
- input: 'smolbote.5.asciidoc',
- output: 'smolbote.5',
-
- command: [asciidoctor, '--backend=manpage', '--out-file=@OUTPUT@', '@INPUT@'],
-
- build_by_default: true,
- install: true,
- install_dir: get_option('mandir') / 'man5'
- )
-
-endif
+asciidoctor = find_program('asciidoctor', required: get_option('manpage'))
+
+custom_target('manpage.7',
+ # list depend_files so the output can be updated if any of them are changed
+ depend_files: ['smolbote.7.asciidoc', 'Usage/CommandLine.asciidoc', 'Usage/Configuration.asciidoc', 'Usage/Profile.asciidoc', 'Usage/Plugins.asciidoc', 'Usage/Filter.asciidoc'],
+
+ input: 'smolbote.7.asciidoc',
+ output: 'smolbote.7',
+
+ command: [asciidoctor, '--backend=manpage', '--out-file=@OUTPUT@', '@INPUT@'],
+
+ build_by_default: get_option('manpage').enabled(),
+ install: get_option('manpage').enabled(),
+ install_dir: join_paths(get_option('mandir'), 'man7')
+)
+
+custom_target('manpage.5',
+ # list of files this target depends on
+ depend_files: ['smolbote.5.asciidoc'],
+
+ input: 'smolbote.5.asciidoc',
+ output: 'smolbote.5',
+
+ command: [asciidoctor, '--backend=manpage', '--out-file=@OUTPUT@', '@INPUT@'],
+
+ build_by_default: get_option('manpage').enabled(),
+ install: get_option('manpage').enabled(),
+ install_dir: get_option('mandir') / 'man5'
+)
+
+custom_target('manual',
+ depend_files: ['smolbote.asciidoc'],
+
+ input: 'smolbote.asciidoc',
+ output: 'manual.html',
+
+ command: [asciidoctor, '-a', 'imagesdir=images', '--out-file=@OUTPUT@', '@INPUT@'],
+
+ build_by_default: false,
+ install: false
+)
+
diff --git a/doc/smolbote.asciidoc b/doc/smolbote.asciidoc
new file mode 100644
index 0000000..101ce77
--- /dev/null
+++ b/doc/smolbote.asciidoc
@@ -0,0 +1,22 @@
+= smolbote: yet another no-frills web browser
+:doctype: book
+:toc: left
+:data-uri:
+
+[preface]
+image::browser-for-fun.png[World Domination cat, role="thumb right"]
+smolbote is a cross-platform keep-it-simple free software web browser based on
+Qt and QtWebEngine.
+
+'''
+
+include::Usage/CommandLine.asciidoc[]
+
+include::Usage/Configuration.asciidoc[]
+
+include::Usage/Profile.asciidoc[]
+
+include::Usage/Plugins.asciidoc[]
+
+include::Usage/Filter.asciidoc[]
+
diff --git a/linux/poi.fish b/linux/poi.fish
new file mode 100644
index 0000000..d0b3e21
--- /dev/null
+++ b/linux/poi.fish
@@ -0,0 +1,11 @@
+# -c short option <short>
+# -l long option <long>
+# -a accepts option "option1 option2"
+
+complete -c poi -s h -l help --description 'Display command-line options list.'
+complete -c poi -s v -l version --description 'Display version information.'
+complete -c poi -l build --description 'Display build commit.'
+complete -c poi -s c -l config -r --description 'Set configuration file.'
+complete -c poi -l no-remote --description 'Do not accept or send remote commands.'
+complete -c poi -s s -l session -r --description 'Open the selected session'
+complete -c poi -l pick-session --description 'Show all available sessions and select which one to open.'
diff --git a/meson.build b/meson.build
index e5b542c..d903910 100644
--- a/meson.build
+++ b/meson.build
@@ -3,6 +3,12 @@ project('smolbote', 'cpp',
default_options: ['cpp_std=c++17', 'strip=true', 'warning_level=3'],
license: 'GPL3')
+# autogenerate qtcreator project files
+# add_postconf_script(script_name, arg1, arg2, ...)
+# will run the executable given as an argument after all project files have been generated.
+# This script will have the environment variables MESON_SOURCE_ROOT and MESON_BUILD_ROOT set.
+#meson.add_postconf_script('tools/gen-qtcreator-config.py', '--prefix=../smolbote', '.')
+
# Qt 5
qt5 = import('qt5')
dep_qt5 = dependency('qt5', modules: ['Core', 'Network', 'Widgets', 'WebEngineWidgets', 'Test'])