diff --git a/Makefile b/Makefile index 48f314f93..6a0da9476 100644 --- a/Makefile +++ b/Makefile @@ -1129,7 +1129,7 @@ manager_cpan: manager_conf @mv ${SRCMANAGERDIR}/Lemonldap*.gz . documentation: - @cd doc/ && ../scripts/doc.pl + @cd doc/sources/admin/ && make html test-diff: @for file in `find lemonldap-ng-*/lib -type f`; do \ diff --git a/scripts/doc.pl b/scripts/doc.pl deleted file mode 100755 index a030d6772..000000000 --- a/scripts/doc.pl +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/perl - -#==================================================================== -# Offline doc script -# -# Use Dokuwiki exportsite plugin -# https://www.dokuwiki.org/plugin:siteexport -# -# This script is part of LemonLDAP::NG project -# Released under GPL license -#==================================================================== - -use strict; -use LWP::Simple; -use Tie::File; - -my $version = "2.0"; -my $offline_zip_url = "http://lemonldap-ng.org/documentation/$version/start?depth=0&depthType=1.0&disableCache=1&do=siteexport&ens=documentation%3A$version%3Astart&exportLinkedPages=1&exportbody=1&renderer=&template=bootstrap3&disableplugin[]=acl&disableplugin[]=config&disableplugin[]=extension&disableplugin[]=oddeven&disableplugin[]=siteexport&disableplugin[]=usermanager"; -my $rc; - -# Get offline archive -$rc = getstore( $offline_zip_url, 'siteexport.zip' ); -exit 1 if ( is_error($rc) ); - -# Remove old doc -system('rm -rf pages/documentation/current/*'); - -# Unzip archive -system("unzip -o siteexport.zip -d pages/documentation/current/"); -system("rm -f siteexport.zip"); - -# Remove some files -system('rm -rf pages/documentation/current/screenshots'); -system('rm -rf pages/documentation/current/_export'); - -# Remove external logos and replace them by a default image -system('rm -rf pages/documentation/current/applications/*png pages/documentation/current/applications/*gif pages/documentation/current/applications/*jpeg'); -system('find . -name \*.html -exec sed -i "s#applications/[^\"]*\.\(png\|jpeg\|gif\)#icons/kmultiple.png#g" {} \;'); - -# Remove background image -system('sed -i "s#/lib/tpl/bootstrap3/images/background.jpeg##g" pages/documentation/current/lib/exe/css*'); - -# Remove alternate and canonical head links fo fix lintian privacy-breach-generic errors -system('find . -name \*.html -exec sed -i "/) { - last if (m#^/\*.*jQuery#); - $buf .= $_; -} -close F; -open F, ">pages/documentation/current/lib/exe/js.php.t.bootstrap3.js"; -print F $buf; -close F; - -# Unminify CSS (to avoid "src is missing" warning -open F, 'pages/documentation/current/lib/exe/css.php.t.bootstrap3.css'; -$buf = join '', map { - s/([;\}\{])/$1\n/g; - $_; -} ; -close F; -open F, '>pages/documentation/current/lib/exe/css.php.t.bootstrap3.css'; -print F $buf; -close F; - -# Replace links in HTML files -my $cssbootstrap = ' - -'; -my $jquery = ' - -'; -my $jqueryui = ' - -'; - -open CMD, "find . -name '*.html'|"; -my @list = map { chomp; $_ } ; -close CMD; - -for my $file (@list) { - open F, $file; - my $buf = join '', map { -s#)#$1 -$cssbootstrap#; - s#()#$1 -$jquery -$jqueryui#; - $_; - } ; - open F, ">$file"; - print F $buf; - close F; -} - -# Restore jquery-ui -system('cp ../lemonldap-ng-portal/site/htdocs/static/bwr/jquery-ui/* pages/documentation/current/lib/scripts/'); - -# Put content in a container -system('find . -name \*.html -exec sed -i "s#
#
#" {} \;'); - -# Responsive images -system('find . -name \*.html -exec sed -i "s###" {} \;'); - -# Tables -system('find . -name \*.html -exec sed -i "s##
#" {} \;'); - -# Link duplicates files -system(q@find . -type f -printf "%s %p\n"|sort -n|perl -a -ne 'if($F[0]==$lf&&`md5sum $F[1]|cut -f1 -d" "` eq `md5sum $ln|cut -f1 -d" "`){print "ln -srf $ln $F[1]\n"}else{$lf=$F[0];$ln=$F[1]}'|sh@); - -system('rm -rf pages/documentation/current/bootswatch pages/documentation/current/lib/scripts/jquery-ui*'); - -exit 0;