Skip to content

Commit 9983411

Browse files
committed
Update doc
1 parent 581d1e4 commit 9983411

File tree

5 files changed

+224
-118
lines changed

5 files changed

+224
-118
lines changed

AUTHORS.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
1-
# Project Authors
1+
# Developer
22

3-
[George Yunaev][1], the author of kchmviewer.
3+
[George Yunaev](https://github.com/gyunaev), the author of KchmViewer.
44

5+
# 3rd Party
56

6-
## 3rd Party
7+
- [Jed Wing](https://github.com/jedwing), the author of CHMLib.
8+
- [Razvan Cojocaru](https://github.com/rzvncj), the author of file `lib/libebook/bitfiddle.h`.
79

8-
- [Jed Wing][2], the author of [CHMLib][3].
9-
- [Razvan Cojocaru][4], the author of file `lib/libebook/bitfiddle.h`.
1010

11+
# Contributors
1112

1213
## Patches
1314

14-
- [Zhong Jianxin][5].
15+
- [Zhong Jianxin](https://github.com/azuwis).
1516

1617

1718
## Translations
1819

19-
| locale | translators |
20-
|--------|------------------------|
21-
| cs | Hynek Fabian|
22-
| de | Markus Müller|
23-
| fr | Sun Wukong|
24-
| hu | Csaba Zakarias|
25-
| it | Emilio Scalise|
26-
| nl | Rinse de Vries, Sander Pientka|
27-
| pt_BR | Márcio Moraes|
28-
| ru | Ivan Bobrov, George Yunaev|
29-
| sv | Daniel Nylander|
30-
| tr | Furkan Duman, Ozan Çağlayan|
31-
| uk | Yatsenko Alexandr|
32-
| zh_CN | 林俊, Henry Hu|
33-
| zh_TW | 林俊 |
34-
35-
36-
[1]: https://github.com/gyunaev "GitHub profile"
37-
[2]: https://github.com/jedwing "GitHub profile"
38-
[3]: http://www.jedrea.com/chmlib "Project page (not https)"
39-
[4]: https://github.com/rzvncj "GitHub profile"
40-
[5]: https://github.com/azuwis "GitHub profile"
20+
- Márcio Moraes, Brazilian Portuguese.
21+
- 林俊, Simplified Chinese.
22+
- Henry Hu, Simplified Chinese.
23+
- 林俊, Taiwan Chinese.
24+
- 呂健, Taiwan Chinese.
25+
- Hynek Fabian, Czech.
26+
- Markus Müller, Deutsch.
27+
- Rinse de Vries, Dutch.
28+
- Sander Pientka, Dutch.
29+
- Sun Wukong, French.
30+
- Csaba Zakarias, Hungarian.
31+
- Emilio Scalise, Italian.
32+
- Ivan Bobrov, Russian.
33+
- George Yunaev, Russian.
34+
- [Daniel Nylander](https://github.com/yeager), Swedish.
35+
- [Furkan Duman](https://github.com/fduman), Turkish.
36+
- Ozan Çağlayan, Turkish.
37+
- Yatsenko Alexandr, Ukrainian.

BUILD.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

INSTALL.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# Building KchmViewer
2+
3+
- [Dependencies and Tools](#dependencies-and-tools)
4+
- [Getting sources](#getting-sources)
5+
- [Usage CMake](#usage-cmake)
6+
- [Building in Debian](#building-in-debian)
7+
- [Qmake options](#qmake-options)
8+
9+
10+
## Dependencies and Tools
11+
12+
13+
### Mandatory requirements
14+
15+
- C++11 compiler which is supported by the [Qt SDK][1].
16+
- Qt tools such as `moc` and the resource packer.
17+
- `CMake` or `Qmake` to generate the build scripts. For builds I recommend CMake, and Qmake is mainly used as a Qt Creator project.
18+
- SDK for `Qt 4`, `Qt 5` or `KDE 4`.
19+
- The [CHMLib][2] library for handling chm files. You can choose dynamic or static linking. In the first case, you need a library and headers for development. In the second case you need to download the repository submodule and specify `USE_STATIC_CHMLIB` flag when generating the build script.
20+
- The [libzip][3] library and headers for software development. When building this library from source you will need the [zlib][4] library.
21+
22+
23+
### Optional requirements
24+
25+
- I recommend using [Git][5] to retrieve the source code. Although you can download and unpack the archive with the sources, this option is not covered here. Also, Git is more convenient if you want to use a submodule with CHMLib.
26+
- [GNU Gettext][6] is required to translate the user interface.
27+
28+
29+
## Getting sources
30+
31+
Use the `git clone` command to retrieve the sources. The `-b release` option allows you to switch to the `release` branch immediately after downloading; this branch points to the latest release. If you need static linking to CHMLib, use `--recursive` options to download the CHMLib submodule.
32+
33+
```sh
34+
# Getting the repository together with the submodule
35+
# and switching to the release branch
36+
git clone -b release --recursive https://github.com/u-235/kchmviewer
37+
```
38+
39+
40+
## Usage CMake
41+
42+
A modern [cmake][7] generates an build system script and also can be used as a build and installation driver.
43+
44+
```sh
45+
# Generate build system
46+
cmake [<options>] ../
47+
# Bbilding mode
48+
cmake --build . [<options>]
49+
# Installation mode
50+
cmake --install . [<options>]
51+
```
52+
53+
54+
### Options of build system generation
55+
56+
* `-G` - specifies a build system generator. This option is not necessary when using the default toolkit.
57+
* `--install-prefix <prefix>` - specifies a root folder for install application. By defaults to `/usr/local` on UNIX and `c:/Program Files/kchmviewer` on Windows. Note, that the installation prefix can be overridden when CMake is run in installation mode (`cmake --install`) with the `--prefix` option. Cpack ignores the installation prefix.
58+
* `-D <var>=<value>` - specifies the initial value of the CMake script variable.
59+
60+
**Project-specific variables**
61+
62+
- `FRAMEWORK=<Qt4 | Qt5 | KDE4>` - choosing the framework with which to build the application, default is `Qt5`.
63+
- `USE_STATIC_CHMLIB=<ON | OFF>` - choosing static linking with CHMLib, default is `OFF`. For static linking, the library is compiled from source in the `lib/CHMLib` folder. This folder can be obtained along with the sources of the application using the command `git clone --recursive`.
64+
- `USE_WEBENGINE=<ON | OFF>` - choosing WebEngine instead of WebKit, default is `OFF`. WebEngine requires Qt version 5.9 or higher.
65+
- `USE_GETTEXT=<ON | OFF>` - enabling translation of the application, default is `ON`. If Gettext is not available, this option will be ignored.
66+
- `USE_DEPLOY_RUNTIME=<ON | OFF>` - copying runtime dependencies for deployment, default is `OFF`.
67+
- `chmlib_ROOT=<path/to/chmlib>`- specifies an additional folder to look up the library and headers for CHMLib. The `chm_lib.h` file is expected either in the root folder or the `include` folder. The `chm` library must be either in the root folder or in the `lib` folder.
68+
- `libzip_ROOT=<path/to/libzip>`- specifies an additional folder to look up the library and headers for libzip. The `zip.h` file is expected either in the root folder or the `include` folder. The `zip` library must be either in the root folder or in the `lib` folder.
69+
70+
**CMake-specific variables**
71+
72+
- `CMAKE_PREFIX_PATH=<path/to/qt>` is the path to the Qt development package if it is simply unpacked or builds without installation. In my case, Qt version 5.5 is in /home/user/Qt and I use `-DCMAKE_PREFIX_PATH=~/Qt/5.5/gcc`.
73+
- `CMAKE_BUILD_TYPE=<Debug | Release | RelWithDebInfo | MinSizeRel>`
74+
75+
For example, configure cmake to build which Qt 5.15 and WebEngine
76+
77+
```sh
78+
cmake -DCMAKE_PREFIX_PATH=~/Qt/5.15/gcc -DUSE_WEBENGINE=ON ../
79+
```
80+
81+
82+
### Cpack
83+
84+
CMake comes with a `cpack` utility for generating installers. The build scripts have basic `cpack` support, but in some cases [additional options][8] and [variables][9] may need to be specified. The [generator][10] must be specified in any case.
85+
86+
87+
## Building in Debian
88+
89+
In GNU/Linux with package manager DEB-based for any build configurations you need the following packages and their dependencies:
90+
91+
- `build-essential` `cmake` `git` `libzip-dev`
92+
- `libchm-dev`
93+
- `gettext`
94+
95+
The table lists the required additional packages and CMake options for varios build configuration.
96+
97+
| Configuration | Packages | CMake Options |
98+
|------------------|-------------------------------------------------|----------------------|
99+
| Qt 5 + WebKit | `qt5-default` `libqt5webkit5-dev` | |
100+
| Qt 5 + WebEngine | `qt5-default` `qtwebengine5-dev-dev` | `-DUSE_WEBENGINE=ON` |
101+
| Qt 4 | `qt4-default` `libqtwebkit-dev` | `-DFRAMEWORK=QT4` |
102+
| KDE 4 | `qt4-default` `libqtwebkit-dev` `kdelibs5-dev` | `-DFRAMEWORK=KDE4` |
103+
104+
105+
### Build with WebKit
106+
107+
```sh
108+
apt install build-essential cmake git libzip-dev libchm-dev\
109+
gettext qt5-default libqt5webkit5-dev
110+
git clone -b release --recursive https://github.com/u-235/kchmviewer
111+
mkdir kchmviewer/build
112+
cd kchmviewer/build
113+
cmake -DCMAKE_BUILD_TYPE=Release ../
114+
cmake --build . --config Release
115+
# Optional generate package
116+
cpack -G DEB -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON
117+
```
118+
119+
120+
### Build with WebEngine
121+
122+
```sh
123+
apt install build-essential cmake git libzip-dev libchm-dev\
124+
gettext qt5-default qtwebengine5-dev
125+
git clone -b release --recursive https://github.com/u-235/kchmviewer
126+
mkdir kchmviewer/build
127+
cd kchmviewer/build
128+
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_WEBENGINE=ON ../
129+
cmake --build . --config Release
130+
# Optional generate package
131+
cpack -G DEB -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON
132+
```
133+
134+
135+
### Build with KDE4
136+
137+
```sh
138+
apt install build-essential cmake git libzip-dev libchm-dev\
139+
gettext qt4-default libqtwebkit-dev kdelibs5-dev
140+
git clone -b release --recursive https://github.com/u-235/kchmviewer
141+
mkdir kchmviewer/build
142+
cd kchmviewer/build
143+
cmake -DCMAKE_BUILD_TYPE=Release -DFRAMEWORK=KDE4 ../
144+
cmake --build . --config Release
145+
# Optional generate package
146+
cpack -G DEB -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON
147+
```
148+
149+
150+
## Qmake options
151+
152+
The project options for qmake are the similar to those for cmake.
153+
154+
- `USE_STATIC_CHMLIB=1` if defined, use static CHMLib from git submodule.
155+
- `USE_WEBENGINE=1` if defined, use QtWebEngine.
156+
- `CHMLIB_ROOT=<path/to/chmlib>` folder to look up the library and headers for CHMLib.
157+
- `LIBZIP_ROOT=<path/to/libzip>`folder to look up the library and headers for libzip.
158+
159+
160+
[1]: https://doc.qt.io/qt-5/supported-platforms.html "Qt doc: supported platforms"
161+
[2]: https://github.com/jedwing/CHMLib "CHMLib repositoriy"
162+
[3]: https://github.com/nih-at/libzip "libzip repositoriy"
163+
[4]: https://github.com/madler/zlib "zlib repositoriy"
164+
[5]: https://git-scm.com/ "Git home page"
165+
[6]: https://www.gnu.org/software/gettext "GNU Gettext home page"
166+
[7]: https://cmake.org/cmake/help/latest/manual/cmake.1.html "Launch cmake"
167+
[8]: https://cmake.org/cmake/help/latest/manual/cpack.1.html "Launch cpack"
168+
[9]: https://cmake.org/cmake/help/latest/module/CPack.html "Cpack module"
169+
[10]: https://cmake.org/cmake/help/latest/manual/cpack-generators.7.html "cpack generators"

NEWS.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## 2021-10-07 Release 8.1
2+
3+
This release is dedicated to the translation of the UI. Initially, translation worked only in an application which was built with KDE support.
4+
5+
* Added KDE-independent UI translation support using GNU Gettext. QT and KDE dialogs and messages are also translated if appropriate files are available.
6+
* Updated translation into Russian.
7+
* The build script has been updated to better support application installation on Windows and macOS.
8+
* Fixed a bug in showing pages of some EPUB files. EPUB files contain XML, but the app treated them as HTML. And if XML contains self-closing `title` tag, then browser was considered it as invalid HTML and did not show content.
9+
* Fixed a bug in a file filter for the Open File dialog box in KDE. Due to an error in the filter description, the Open File dialog shows only CHM files. Now, the dialog has three display options:
10+
- All supported books
11+
- CHM only
12+
- EPUB only
13+
* Fixed a bug of parsing command line arguments with non-Latin characters, occurring in KDE.
14+
15+
16+
## 2021-09-20 Release 8.0
17+
18+
This release has two goals: the option to use QtWebEngine and the migration to cmake as the primary build system.
19+
20+
* Full support for QtWebEngine since Qt 5.9, including the ability to change page encoding.
21+
* When building an application, it is possible to choose HTML engine: QtWebKit or QtWebEngine.
22+
* Updated Cmake scripts to build applications without depending on KDE. This allows Cmake to build applications for Windows, macOS and Linux using only Qt.
23+
* Added initial support for Cpack.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ This is a fork of the [kchmviewer](http://www.ulduzsoft.com/linux/kchmviewer) wi
1313

1414
## Overview
1515

16-
KchmViewer is a chm (MS HTML help file format) and epub viewer, written in C++. Unlike most existing CHM viewers for Unix, it uses Trolltech Qt widget library, and does not depend on KDE or GNOME. It has full KDE4 support.
16+
KchmViewer is a chm (MS HTML help file format) and epub viewer, written in C++. Unlike most existing CHM viewers for Unix, it uses Trolltech Qt widget library, and does not depend on KDE or GNOME. It has full KDE 4 support.
1717

1818
The main advantage of KchmViewer is extended support for non-English languages. Unlike others, KchmViewer in most cases correctly detects chm file encoding, correctly shows tables of context of Russian, Korean, Chinese and Japanese help files. It also correctly searches text in non-English help files, including Korean, Chinese and Japanese.
1919

2020
KchmViewer is written by [Georgy Yunaev](https://github.com/gyunaev), and is licensed under GNU GPL license version 3.
2121

2222

23-
## What's new
23+
## What's New
2424

25-
- Full support for QtWebEngine since Qt 5.9, including the ability to change page encoding.
26-
- When building an application, it is possible to choose HTML engine: QtWebKit or QtWebEngine.
25+
The 8.1 release is dedicated to the translation of the UI. Initially, translation worked only in an application which was built with KDE support. Now, this is possible with GNU Gettext for the target platform and is independent of KDE. However, the translation files are outdated and only Russian translation is up to date.
26+
Read more in the [release notes](NEWS.md).
2727

2828

2929
## Features
3030

31-
- Standalone viewer, depends on Qt4 or Qt5 only. Does not require KDE, GNOME or wxWidgets toolkit.
32-
- Could be optionally built with KDE4 or KDE5 support, using KDE dialogs.
31+
- Standalone viewer, depends on Qt 4 or Q t5 only. Does not require KDE, GNOME or wxWidgets toolkit.
32+
- Could be optionally built with KDE 4 or KDE 5 support, using KDE dialogs.
3333
- Completely safe and harmless. JavaScript can be disabled in the settings, optionally warns you before opening an external web page, or switching to another help file.
3434
- Correctly detects and shows encoding of any valid chm file.
3535
- Correctly shows non-English chm files, including Cyrillic, Chinese, Japanese and others.
@@ -49,7 +49,7 @@ KchmViewer is written by [Georgy Yunaev](https://github.com/gyunaev), and is lic
4949

5050
The application is currently distributed in source code and you need to build it on your computer. This will not take long.
5151

52-
Go to the [build instructions page](BUILD.md).
52+
Go to the [build instructions page](INSTALL.md).
5353

5454

5555
## Usage

0 commit comments

Comments
 (0)