quran-madina-html 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jshintignore +1 -1
- package/Gruntfile.js +76 -76
- package/README.md +55 -55
- package/assets/db/Madina05-Amiri%Quran%Colored-16px.json +0 -0
- package/assets/db/Madina05-Amiri%Quran%Colored-24px.json +0 -0
- package/assets/db/Madina05-Amiri%Quran-16px.json +0 -0
- package/assets/db/Madina05-Hafs-16px.json +0 -0
- package/assets/db/Madina05-Uthman-16px.json +0 -0
- package/assets/db/Madina05-me_quran-16px.json +0 -0
- package/assets/fonts/AmiriQuran.woff2 +0 -0
- package/assets/fonts/AmiriQuranColored.woff2 +0 -0
- package/assets/fonts/Hafs.woff2 +0 -0
- package/assets/fonts/UthmanTN_v2-0.woff2 +0 -0
- package/assets/fonts/me_quran-Regular.woff2 +0 -0
- package/assets/fonts/www.unpkg.com/quran-madina-html@0.2.4/dist/quran-madina-html.min.css +1 -0
- package/bower.json +15 -15
- package/demo/index.html +20 -20
- package/dist/quran-madina-html.js +237 -171
- package/dist/quran-madina-html.min.css +1 -1
- package/dist/quran-madina-html.min.js +2 -2
- package/package.json +52 -52
- package/requirements.txt +0 -0
- package/src/db/build_all.py +38 -38
- package/src/db/build_db.py +472 -472
- package/src/quran-madina-html.css +35 -11
- package/src/quran-madina-html.js +237 -171
- package/src/template/part_width_test.html +40 -40
- package/test/db_test.py +79 -79
package/.jshintignore
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
src/x-tag-components.js
|
|
1
|
+
src/x-tag-components.js
|
package/Gruntfile.js
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
module.exports = function(grunt) {
|
|
2
|
-
|
|
3
|
-
grunt.initConfig({
|
|
4
|
-
pkg: grunt.file.readJSON('package.json'),
|
|
5
|
-
concat: {
|
|
6
|
-
options: {
|
|
7
|
-
separator: ';'
|
|
8
|
-
},
|
|
9
|
-
dist: {
|
|
10
|
-
src: ['src/<%= pkg.name %>.js',
|
|
11
|
-
'bower_components/x-tag-core/dist/x-tag-core.min.js'],
|
|
12
|
-
dest: 'dist/<%= pkg.name %>.js'
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
uglify: {
|
|
16
|
-
options: {
|
|
17
|
-
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
|
|
18
|
-
},
|
|
19
|
-
dist: {
|
|
20
|
-
files: {
|
|
21
|
-
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
cssmin: {
|
|
26
|
-
target: {
|
|
27
|
-
files: [{
|
|
28
|
-
expand: true,
|
|
29
|
-
cwd: 'src',
|
|
30
|
-
src: ['*.css', '!*.min.css'],
|
|
31
|
-
dest: 'dist',
|
|
32
|
-
ext: '.min.css'
|
|
33
|
-
}]
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
jshint: {
|
|
37
|
-
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
|
|
38
|
-
options: {
|
|
39
|
-
// options here to override JSHint defaults
|
|
40
|
-
globals: {
|
|
41
|
-
jQuery: true,
|
|
42
|
-
console: true,
|
|
43
|
-
module: true,
|
|
44
|
-
document: true
|
|
45
|
-
},
|
|
46
|
-
esnext: true
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
'json-minify': {
|
|
50
|
-
build: {
|
|
51
|
-
files: 'assets/db/*.json'
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
clean : {
|
|
55
|
-
yourTarget : {
|
|
56
|
-
src : [ "dist"
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
watch: {
|
|
61
|
-
files: ['<%= jshint.files %>'],
|
|
62
|
-
tasks: ['jshint']
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
67
|
-
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
68
|
-
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
69
|
-
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
70
|
-
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
71
|
-
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
|
72
|
-
grunt.loadNpmTasks('grunt-json-minify');
|
|
73
|
-
|
|
74
|
-
grunt.registerTask('test', ['jshint']);
|
|
75
|
-
grunt.registerTask('default', ['jshint', 'clean', 'concat', 'uglify', 'cssmin', 'json-minify']);
|
|
76
|
-
|
|
1
|
+
module.exports = function(grunt) {
|
|
2
|
+
|
|
3
|
+
grunt.initConfig({
|
|
4
|
+
pkg: grunt.file.readJSON('package.json'),
|
|
5
|
+
concat: {
|
|
6
|
+
options: {
|
|
7
|
+
separator: ';'
|
|
8
|
+
},
|
|
9
|
+
dist: {
|
|
10
|
+
src: ['src/<%= pkg.name %>.js',
|
|
11
|
+
'bower_components/x-tag-core/dist/x-tag-core.min.js'],
|
|
12
|
+
dest: 'dist/<%= pkg.name %>.js'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
uglify: {
|
|
16
|
+
options: {
|
|
17
|
+
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
|
|
18
|
+
},
|
|
19
|
+
dist: {
|
|
20
|
+
files: {
|
|
21
|
+
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
cssmin: {
|
|
26
|
+
target: {
|
|
27
|
+
files: [{
|
|
28
|
+
expand: true,
|
|
29
|
+
cwd: 'src',
|
|
30
|
+
src: ['*.css', '!*.min.css'],
|
|
31
|
+
dest: 'dist',
|
|
32
|
+
ext: '.min.css'
|
|
33
|
+
}]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
jshint: {
|
|
37
|
+
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
|
|
38
|
+
options: {
|
|
39
|
+
// options here to override JSHint defaults
|
|
40
|
+
globals: {
|
|
41
|
+
jQuery: true,
|
|
42
|
+
console: true,
|
|
43
|
+
module: true,
|
|
44
|
+
document: true
|
|
45
|
+
},
|
|
46
|
+
esnext: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
'json-minify': {
|
|
50
|
+
build: {
|
|
51
|
+
files: 'assets/db/*.json'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
clean : {
|
|
55
|
+
yourTarget : {
|
|
56
|
+
src : [ "dist"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
watch: {
|
|
61
|
+
files: ['<%= jshint.files %>'],
|
|
62
|
+
tasks: ['jshint']
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
67
|
+
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
68
|
+
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
69
|
+
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
70
|
+
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
71
|
+
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
|
72
|
+
grunt.loadNpmTasks('grunt-json-minify');
|
|
73
|
+
|
|
74
|
+
grunt.registerTask('test', ['jshint']);
|
|
75
|
+
grunt.registerTask('default', ['jshint', 'clean', 'concat', 'uglify', 'cssmin', 'json-minify']);
|
|
76
|
+
|
|
77
77
|
};
|
package/README.md
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# Quran Madina Html (no-images)
|
|
2
|
-
[](https://github.com/tarekeldeeb/quran-madina-html/actions/workflows/pylint.yml)
|
|
3
|
-
[](https://github.com/tarekeldeeb/quran-madina-html/actions/workflows/db_test.yml)
|
|
4
|
-
[](https://github.com/tarekeldeeb/quran-madina-html/actions/workflows/npm-grunt.yml)
|
|
5
|
-
|
|
6
|
-
A Madina Quran HTML Renderer without images
|
|
7
|
-
|
|
8
|
-
Theres a pre-processing python script to generate Json databases with quran text with special metadata. The preprocessing is based on text from [Tanzil](tanzil.net), and the [OCR DB](https://github.com/quran/ayah-detection) downloaded from [Murtaza Raja](https://github.com/murtraja/quran-android-images-helper) helper project.
|
|
9
|
-
Afterwards, the JS library uses those Json objects to render Madina-based Quran pages and lines.
|
|
10
|
-
|
|
11
|
-
The main purpose of this library is:
|
|
12
|
-
* Render Quran text that's visually similar to Madina Printed Pages
|
|
13
|
-
* Efficient Loading of Quran Visual Text (Not image-based, but pure Html)
|
|
14
|
-
* Easy to use: just a simple HTML tag!
|
|
15
|
-
|
|
16
|
-
<img src="https://github.com/tarekeldeeb/quran-madina-html/assets/90985/dc3972c3-71a6-4f48-8d45-2df28ddc409f" width="750px">
|
|
17
|
-
|
|
18
|
-
# Getting Started
|
|
19
|
-
In your Html header, add this script:
|
|
20
|
-
```html
|
|
21
|
-
<script type="text/javascript" src="https://unpkg.com/quran-madina-html"></script>
|
|
22
|
-
```
|
|
23
|
-
* Supported ``data-name`` parameters are: Madina05 (default), others are under development (Shemerly, Qaloon, Newer Madina)
|
|
24
|
-
* Supported ``data-font`` parameters are: Hafs (default), Uthman, Amiri Quran, Amiri Quran Colored
|
|
25
|
-
* Other options include: ``data-font-size`` which defaults to 16 (px)
|
|
26
|
-
|
|
27
|
-
Then in your body, just add the tag.
|
|
28
|
-
```html
|
|
29
|
-
<quran-madina-html sura="2" aya="8-10"></quran-madina-html>
|
|
30
|
-
```
|
|
31
|
-
If the selected aya(s) fit on a single line, the default is to generate an inline ``<span>`` element, otherwise a ``<div>`` is generated.
|
|
32
|
-
|
|
33
|
-
# Dev Setup
|
|
34
|
-
|
|
35
|
-
The project is published on npm ``npm install quran-madina-html``, with sources, assets and distributables.
|
|
36
|
-
Alternatively, you can fork this repo, then clone it.
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
$ apt install python3-distutils nodejs npm chromium-driver
|
|
40
|
-
$ npm install // install components and scripts
|
|
41
|
-
$ bower install // install bower libs
|
|
42
|
-
$ npm run build-db // build all json Db files
|
|
43
|
-
$ npm run release // build the dist with dependencies
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
# Demo
|
|
48
|
-
|
|
49
|
-
https://tarekeldeeb.github.io/quran-madina-html/demo/index.html
|
|
50
|
-
|
|
51
|
-
Don't forget to see the page source!
|
|
52
|
-
|
|
53
|
-
# Links
|
|
54
|
-
|
|
55
|
-
[X-Tags Docs](http://x-tags.org/docs)
|
|
1
|
+
# Quran Madina Html (no-images)
|
|
2
|
+
[](https://github.com/tarekeldeeb/quran-madina-html/actions/workflows/pylint.yml)
|
|
3
|
+
[](https://github.com/tarekeldeeb/quran-madina-html/actions/workflows/db_test.yml)
|
|
4
|
+
[](https://github.com/tarekeldeeb/quran-madina-html/actions/workflows/npm-grunt.yml)
|
|
5
|
+
|
|
6
|
+
A Madina Quran HTML Renderer without images
|
|
7
|
+
|
|
8
|
+
Theres a pre-processing python script to generate Json databases with quran text with special metadata. The preprocessing is based on text from [Tanzil](tanzil.net), and the [OCR DB](https://github.com/quran/ayah-detection) downloaded from [Murtaza Raja](https://github.com/murtraja/quran-android-images-helper) helper project.
|
|
9
|
+
Afterwards, the JS library uses those Json objects to render Madina-based Quran pages and lines.
|
|
10
|
+
|
|
11
|
+
The main purpose of this library is:
|
|
12
|
+
* Render Quran text that's visually similar to Madina Printed Pages
|
|
13
|
+
* Efficient Loading of Quran Visual Text (Not image-based, but pure Html)
|
|
14
|
+
* Easy to use: just a simple HTML tag!
|
|
15
|
+
|
|
16
|
+
<img src="https://github.com/tarekeldeeb/quran-madina-html/assets/90985/dc3972c3-71a6-4f48-8d45-2df28ddc409f" width="750px">
|
|
17
|
+
|
|
18
|
+
# Getting Started
|
|
19
|
+
In your Html header, add this script:
|
|
20
|
+
```html
|
|
21
|
+
<script type="text/javascript" src="https://unpkg.com/quran-madina-html"></script>
|
|
22
|
+
```
|
|
23
|
+
* Supported ``data-name`` parameters are: Madina05 (default), others are under development (Shemerly, Qaloon, Newer Madina)
|
|
24
|
+
* Supported ``data-font`` parameters are: Hafs (default), Uthman, Amiri Quran, Amiri Quran Colored
|
|
25
|
+
* Other options include: ``data-font-size`` which defaults to 16 (px)
|
|
26
|
+
|
|
27
|
+
Then in your body, just add the tag.
|
|
28
|
+
```html
|
|
29
|
+
<quran-madina-html sura="2" aya="8-10"></quran-madina-html>
|
|
30
|
+
```
|
|
31
|
+
If the selected aya(s) fit on a single line, the default is to generate an inline ``<span>`` element, otherwise a ``<div>`` is generated.
|
|
32
|
+
|
|
33
|
+
# Dev Setup
|
|
34
|
+
|
|
35
|
+
The project is published on npm ``npm install quran-madina-html``, with sources, assets and distributables.
|
|
36
|
+
Alternatively, you can fork this repo, then clone it.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
$ apt install python3-distutils nodejs npm chromium-driver
|
|
40
|
+
$ npm install // install components and scripts
|
|
41
|
+
$ bower install // install bower libs
|
|
42
|
+
$ npm run build-db // build all json Db files
|
|
43
|
+
$ npm run release // build the dist with dependencies
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
# Demo
|
|
48
|
+
|
|
49
|
+
https://tarekeldeeb.github.io/quran-madina-html/demo/index.html
|
|
50
|
+
|
|
51
|
+
Don't forget to see the page source!
|
|
52
|
+
|
|
53
|
+
# Links
|
|
54
|
+
|
|
55
|
+
[X-Tags Docs](http://x-tags.org/docs)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/assets/fonts/Hafs.woff2
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
quran-madina-html{/* padding: 0px 0px 7px 0px; */background-color:beige;border-radius:5px;overflow: hidden;}quran-madina-html-line{text-align:right;white-space:nowrap;transform-origin:top right;padding: 0px 5px 0px 5px;transition:background-color 1s ease}
|
package/bower.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "quran-madina-html",
|
|
3
|
-
"description": "",
|
|
4
|
-
"version": "0.1.1",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"web-components",
|
|
7
|
-
"x-tag"
|
|
8
|
-
],
|
|
9
|
-
"main": [
|
|
10
|
-
"src/quran-madina-html.js",
|
|
11
|
-
"src/quran-madina-html.css"
|
|
12
|
-
],
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"x-tag-core": "*"
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "quran-madina-html",
|
|
3
|
+
"description": "",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"web-components",
|
|
7
|
+
"x-tag"
|
|
8
|
+
],
|
|
9
|
+
"main": [
|
|
10
|
+
"src/quran-madina-html.js",
|
|
11
|
+
"src/quran-madina-html.css"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"x-tag-core": "*"
|
|
15
|
+
}
|
|
16
16
|
}
|
package/demo/index.html
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html dir="rtl" lang="ar">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<title>quran-madina-html مشروع</title>
|
|
7
|
-
<script type="text/javascript" src="https://unpkg.com/quran-madina-html"></script>
|
|
8
|
-
</head>
|
|
9
|
-
|
|
10
|
-
<body>
|
|
11
|
-
<h2>عرض لإمكانية مشروع قران المدينة Html بدون صور</h2>
|
|
12
|
-
|
|
13
|
-
يمكن عرض نص آية قصيرة وسط الكلام مثل قوله تعالى:
|
|
14
|
-
<quran-madina-html sura="1" aya="3"></quran-madina-html>
|
|
15
|
-
واذا تم اختيار ايات تمتد لأكثر من سطر، فيتم عرض عدة أسطر متوافقة مع ترتيب كلمات مصحف المدينة بشكل تلقائي
|
|
16
|
-
<quran-madina-html sura="2" aya="13-14"></quran-madina-html>
|
|
17
|
-
يتميز المشروع بأنه مفتوح المصدر ويسهل تغيير الفونت، كما يعمل على مصاحف غير مصحف المدينة
|
|
18
|
-
</body>
|
|
19
|
-
|
|
20
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html dir="rtl" lang="ar">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<title>quran-madina-html مشروع</title>
|
|
7
|
+
<script type="text/javascript" src="https://unpkg.com/quran-madina-html"></script>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<h2>عرض لإمكانية مشروع قران المدينة Html بدون صور</h2>
|
|
12
|
+
|
|
13
|
+
يمكن عرض نص آية قصيرة وسط الكلام مثل قوله تعالى:
|
|
14
|
+
<quran-madina-html sura="1" aya="3"></quran-madina-html>
|
|
15
|
+
واذا تم اختيار ايات تمتد لأكثر من سطر، فيتم عرض عدة أسطر متوافقة مع ترتيب كلمات مصحف المدينة بشكل تلقائي
|
|
16
|
+
<quran-madina-html sura="2" aya="13-14"></quran-madina-html>
|
|
17
|
+
يتميز المشروع بأنه مفتوح المصدر ويسهل تغيير الفونت، كما يعمل على مصاحف غير مصحف المدينة
|
|
18
|
+
</body>
|
|
19
|
+
|
|
20
|
+
</html>
|