Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 51e6c55

Browse files
committed
merged from version3
2 parents 9bf11e7 + f512ad5 commit 51e6c55

173 files changed

Lines changed: 1424 additions & 47048 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
55
# User-specific stuff:
66
.idea/
7+
docsource/project/Data/
8+
docs/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
path = lib/any_data
33
url = https://github.com/jgebal/any_data.git
44
branch = master
5+
[submodule "tools/ndocs"]
6+
path = tools/ndocs
7+
url = https://github.com/rlove/NaturalDocs.git

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ cache:
3636
- $HOME/.cache
3737

3838
before_install:
39+
# perl modules needed for documenation generation
40+
- "cpanm IPC::System::Simple"
41+
- "cpanm Markdent"
42+
- "cpanm File::Map"
3943
# On trusty, download the zip file into a cachable directory
4044
- test "$DIST" = precise || export ORACLE_ZIP_DIR=$HOME/.cache
4145
# If the zip file already exists, do not download it again
@@ -50,6 +54,7 @@ script:
5054
- bash .travis/install.sh
5155
- bash .travis/run_examples.sh
5256
- bash .travis/run_test.sh
57+
- perl docsource/builddocs.pl
5358

5459
notifications:
5560
slack: utplsql:oiMuXO95TvKeAUENuDt4cPrB

docsource/api/index.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

docsource/builddocs.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
perl builddocs.pl

docsource/builddocs.pl

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use IPC::System::Simple qw(system);
5+
use Markdent::Simple::Document;
6+
use Markdent::Simple::Fragment;
7+
use File::Map qw(map_file);
8+
use File::Path qw(make_path);
9+
use Cwd 'abs_path';
10+
11+
use constant false => 0;
12+
use constant true => 1;
13+
14+
main();
15+
16+
sub main{
17+
# turn off buffering of output
18+
$| = 1;
19+
print "Generating utplsql Documenation \n";
20+
print "results will be found in ..\\docs folder \n";
21+
# change current working directory to location of script.
22+
# this keeps realative paths later in script easier to maintain.
23+
# Source: https://sysengineers.wordpress.com/2009/12/04/changing-working-directory-to-script-location-in-perl/
24+
my $path = abs_path($0);
25+
$path =~ s/builddocs.pl//gi;
26+
chdir ($path);
27+
28+
# Create output directories if the don't exists
29+
make_path("../docs");
30+
31+
# Execute NaturalDocs
32+
# -i InputDirectory
33+
# -o FramedHTML or HTML OutputDirectory (Using HTML so we can directly link to documenation pages easier.)
34+
# -p ProectDirectory
35+
# -xi ExcludeDirFromInput
36+
# -r RebuildAllFiles
37+
my @nd_args = qw(
38+
-i ../
39+
-o HTML ../docs/
40+
-p ./project
41+
-xi ../.travis
42+
-xi ../examples
43+
-xi ../lib
44+
-xi ../tools
45+
-xi ../build
46+
-r
47+
);
48+
system($^X, "../tools/ndocs/NaturalDocs", @nd_args);
49+
50+
#convert markdown files to html
51+
#convert_markdown_file("../CONTRIBUTING.md","../docs/files/docsource/topics/contributing-txt.html","How to contribute to utPLSQL");
52+
convert_markdown_and_insert("../CONTRIBUTING.md","../docs/files/docsource/topics/contributing-txt.html");
53+
54+
55+
56+
#Checking for current/past errors with NaturalDocs
57+
check_project_file_for_error("project/Menu.txt");
58+
check_project_file_for_error("project/Languages.txt");
59+
check_project_file_for_error("project/Topics.txt");
60+
if (-e "project/LastCrash.txt") {
61+
die "project/LastCrash.txt found, indicating a prior NaturalDocs problem that should be fixed. Note: File must be manually removed to continue";
62+
}
63+
}
64+
65+
sub check_project_file_for_error {
66+
my $file_to_check = shift;
67+
map_file(my $menufile,$file_to_check);
68+
if ($menufile =~ /ERROR/) { die "ERROR found $file_to_check" }
69+
}
70+
71+
sub convert_markdown {
72+
my $markdowntext = shift;
73+
my $fragment = shift;
74+
my $title = shift;
75+
76+
# convert markdown to html
77+
my $htmltext;
78+
if ($fragment = true) {
79+
my $parser = Markdent::Simple::Fragment->new();
80+
$htmltext = $parser->markdown_to_html(
81+
markdown => $markdowntext);
82+
} else {
83+
my $parser = Markdent::Simple::Document->new();
84+
$htmltext = $parser->markdown_to_html(
85+
markdown => $markdowntext,
86+
title => $title);
87+
}
88+
89+
#return
90+
$htmltext;
91+
}
92+
93+
sub convert_markdown_and_insert {
94+
my $source = shift;
95+
my $dest = shift;
96+
97+
# memory map input file
98+
map_file(my $markdown, $source);
99+
100+
# convert markdown to html
101+
my $html = convert_markdown($markdown,true);
102+
103+
# read output file
104+
open FILE, "<$dest" or die "Couldn't open file: $!";
105+
binmode FILE;
106+
my $output = do { local $/; <FILE> };
107+
close FILE;
108+
109+
#search and replace
110+
$output =~ s/$source/$html/g;
111+
112+
# write output file
113+
open FILE, ">$dest" or die "Couldn't open file: $!";
114+
binmode FILE;
115+
print FILE $output;
116+
close FILE;
117+
118+
print "Inserted $source as html into $dest \n"
119+
}
120+
121+
sub convert_markdown_file {
122+
my $source = shift;
123+
my $dest = shift;
124+
my $title = shift;
125+
126+
# memory map input file
127+
map_file(my $markdown, $source);
128+
129+
# convert markdown to html
130+
my $html = convert_markdown($markdown,false,$title);
131+
132+
# check output file exists, and deletes.
133+
if (-f $dest) {
134+
unlink $dest or die "Cannot delete $dest: $!";
135+
}
136+
137+
# write markdown to file
138+
my $OUTFILE;
139+
open $OUTFILE, '>>', $dest or die "Cannot open $dest";
140+
print { $OUTFILE } $html or die "Cannot write to $dest";
141+
close $OUTFILE or die "Cannot close $dest";
142+
143+
print "Converted $source to $dest \n"
144+
}
145+
146+
147+
148+
149+
150+
151+
152+
153+
154+
155+
156+
157+
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
Format: 1.52
1+
Format: Development Release 07-07-2013 (1.52 base)
22

33
# This is the Natural Docs languages file for this project. If you change
44
# anything here, it will apply to THIS PROJECT ONLY. If you'd like to change
55
# something for all your projects, edit the Languages.txt in Natural Docs'
66
# Config directory instead.
77

88

9-
# You can prevent certain file extensions from being scanned like this:
10-
# Ignore Extensions: [extension] [extension] ...
9+
Ignore Extension: pl
1110

1211

1312
#-------------------------------------------------------------------------------
@@ -115,4 +114,4 @@ Format: 1.52
115114

116115
Alter Language: SQL
117116

118-
Add Extensions: pkb pks
117+
Add Extensions: pks tps
Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
Format: 1.52
1+
Format: Development Release 07-07-2013 (1.52 base)
22

33

4-
Title: UTPLSQL
5-
SubTitle: the unit test suite for Oracle PL/SQL
4+
Title: utPLSQL
5+
SubTitle: v 3.0 Alpha
66

7-
# You can add a footer to your documentation like this:
8-
# Footer: [text]
9-
# If you want to add a copyright notice, this would be the place to do it.
10-
11-
# You can add a timestamp to your documentation like one of these:
12-
# Timestamp: Generated on month day, year
13-
# Timestamp: Updated mm/dd/yyyy
14-
# Timestamp: Last updated mon day
15-
#
7+
Footer: Copyright (c) 2016 - utPLSQL Project
8+
Timestamp: Generated on month day, year
169
# m - One or two digit month. January is "1"
1710
# mm - Always two digit month. January is "01"
1811
# mon - Short month word. January is "Jan"
@@ -45,18 +38,27 @@ SubTitle: the unit test suite for Oracle PL/SQL
4538
# --------------------------------------------------------------------------
4639

4740

48-
Index: Everything
49-
Class Index: Class Index
50-
Function Index: Function Index
51-
File: License (license.txt)
52-
File: ut_metadata (ut_metadata.pks)
53-
File: ut_test_runner (ut_test_runner.pks)
54-
File: ut_types (ut_types.pks)
55-
Type Index: Type Index
56-
Constant Index: Constant Index
41+
Group: Documentation {
42+
43+
File: Installation (docsource/topics/install.txt)
44+
File: Getting Started (docsource/topics/getting-started.txt)
45+
File: Annotations (docsource/topics/Annotations.txt)
46+
File: Support (docsource/topics/Support.txt)
47+
} # Group: Documentation
48+
49+
Group: Source {
50+
51+
File: ut_metadata (source/ut_metadata.pks)
52+
File: ut_utils (source/ut_utils.pks)
53+
File: License (source/license.txt)
54+
File: Contributing (docsource/topics/contributing.txt)
55+
} # Group: Source
5756

5857
Group: Index {
5958

6059
Index: Everything
60+
Class Index: Classes
61+
Constant Index: Constants
62+
Function Index: Functions
6163
} # Group: Index
6264

docsource/project/Topics.txt

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Format: Development Release 07-07-2013 (1.52 base)
2+
3+
# This is the Natural Docs topics file for this project. If you change anything
4+
# here, it will apply to THIS PROJECT ONLY. If you'd like to change something
5+
# for all your projects, edit the Topics.txt in Natural Docs' Config directory
6+
# instead.
7+
8+
9+
# If you'd like to prevent keywords from being recognized by Natural Docs, you
10+
# can do it like this:
11+
# Ignore Keywords: [keyword], [keyword], ...
12+
#
13+
# Or you can use the list syntax like how they are defined:
14+
# Ignore Keywords:
15+
# [keyword]
16+
# [keyword], [plural keyword]
17+
# ...
18+
19+
20+
#-------------------------------------------------------------------------------
21+
# SYNTAX:
22+
#
23+
# Topic Type: [name]
24+
# Alter Topic Type: [name]
25+
# Creates a new topic type or alters one from the main file. Each type gets
26+
# its own index and behavior settings. Its name can have letters, numbers,
27+
# spaces, and these charaters: - / . '
28+
#
29+
# Plural: [name]
30+
# Sets the plural name of the topic type, if different.
31+
#
32+
# Keywords:
33+
# [keyword]
34+
# [keyword], [plural keyword]
35+
# ...
36+
# Defines or adds to the list of keywords for the topic type. They may only
37+
# contain letters, numbers, and spaces and are not case sensitive. Plural
38+
# keywords are used for list topics. You can redefine keywords found in the
39+
# main topics file.
40+
#
41+
# Index: [yes|no]
42+
# Whether the topics get their own index. Defaults to yes. Everything is
43+
# included in the general index regardless of this setting.
44+
#
45+
# Scope: [normal|start|end|always global]
46+
# How the topics affects scope. Defaults to normal.
47+
# normal - Topics stay within the current scope.
48+
# start - Topics start a new scope for all the topics beneath it,
49+
# like class topics.
50+
# end - Topics reset the scope back to global for all the topics
51+
# beneath it.
52+
# always global - Topics are defined as global, but do not change the scope
53+
# for any other topics.
54+
#
55+
# Class Hierarchy: [yes|no]
56+
# Whether the topics are part of the class hierarchy. Defaults to no.
57+
#
58+
# Page Title If First: [yes|no]
59+
# Whether the topic's title becomes the page title if it's the first one in
60+
# a file. Defaults to no.
61+
#
62+
# Break Lists: [yes|no]
63+
# Whether list topics should be broken into individual topics in the output.
64+
# Defaults to no.
65+
#
66+
# Can Group With: [type], [type], ...
67+
# Defines a list of topic types that this one can possibly be grouped with.
68+
# Defaults to none.
69+
#-------------------------------------------------------------------------------
70+
71+
# The following topics are defined in the main file, if you'd like to alter
72+
# their behavior or add keywords:
73+
#
74+
# Generic, Class, Interface, Section, File, Group, Function, Variable,
75+
# Property, Type, Constant, Enumeration, Event, Delegate, Macro,
76+
# Database, Database Table, Database View, Database Index, Database
77+
# Cursor, Database Trigger, Cookie, Build Target
78+
79+
# If you add something that you think would be useful to other developers
80+
# and should be included in Natural Docs by default, please e-mail it to
81+
# topics [at] naturaldocs [dot] org.

docsource/readme.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
#DocSource Folder
22

3+
Contains the files needed to generated documentation. Perl is required to be able to run the generation of documentation.
4+
5+
#How to Run
6+
7+
builddocs.pl
8+
9+
#CPAN Modules
10+
11+
[CPAN Module Install Instructions](http://www.cpan.org/modules/INSTALL.html)
12+
13+
Required Modules:
14+
15+
- IPC::System::Simple
16+
- Markdent
17+
- File::Map
18+
19+
#NaturalDocs
20+
21+
We use NaturalDocs to generate most of the documentation.
22+
23+
It is linked as submodule under /tools/ndocs
24+
25+
326

4-
Contains the source code to the documentation.

0 commit comments

Comments
 (0)