Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error php while using the single page format #30

Closed
remiflament opened this issue Nov 30, 2017 · 6 comments
Closed

Error php while using the single page format #30

remiflament opened this issue Nov 30, 2017 · 6 comments
Labels

Comments

@remiflament
Copy link

Hi,
I use v0.7.0.

When i try to generate my documentation with the format html-file (single file)
daux generate --format=html-file

I get this error :
PHP Warning: file_get_contents(themes/daux_singlepage/css/main.min.css): failed to open stream: No such file or directory in /home/remi/.config/composer/vendor/justinwalsh/daux.io/libs/Format/HTMLFile/Book.php on line 22

In my static folder i verify if i have the css and it's ok : static/themes/daux_singlepage/css/main.min.css.

The function where the code fail is in this file at line 22 :

protected function getStyles()
    {
        // TODO :: un-hardcode that
        return '<style>' . file_get_contents('themes/daux_singlepage/css/main.min.css') . '</style>';
    }
@onigoetz
Copy link
Contributor

Hello
By the path you show me, you are using justinwalsh/daux.io which is the old tool's name.

Can you try to use composer global require daux/daux.io and remove justinwalsh/daux.io ?

I've made some bugfixes to single page documentation generate in version 0.7.1, maybe you can have a look at them ?

@remiflament
Copy link
Author

remiflament commented Dec 11, 2017

Hi,
I downloaded your latest release (v0.7.1) and done : daux generate --format=html-file

But i get this errors :

daux generate --format=html-file
Generating MétaDoc Rémi                                                                                                                                                                           [  OK  ]
Generating Architecture                                                                                                                                                                           [  OK  ]
Generating Adressage Ip                                                                                                                                                                           [  OK  ]
Generating Mon Compte Internet                                                                                                                                                                    [  OK  ]
Generating Alcasar                                                                                                                                                                                [  OK  ]
Generating Architecture HA TESTPHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/Base/EmbedImages.php:41
Stack trace:
#0 /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/Base/EmbedImages.php(75): Todaymade\Daux\Format\Base\EmbedImages->getAttributes('<img src="image...')
#1 /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/Base/EmbedImages.php(29): Todaymade\Daux\Format\Base\EmbedImages->findImage('images/schema1....', '<img src="image...', Object(Todaymade\Daux\Tree\Raw), Object(Closure))
#2 [internal function]: Todaymade\Daux\Format\Base\EmbedImages->Todaymade\Daux\Format\Base\{closure}(Array)
#3 /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/Base/EmbedImages.php(35): preg_replace_callback('/<img\\s+[^>]*sr...', Object(Closure), '<h2 id="page_Ar...')
#4 /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/HTMLFile/ContentPage.php(28): Todaymade\Daux\Format\Base\EmbedImages->embed('<h2 id="page_Ar...', Object(Todaymade\Daux\Tree\Content), O in /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/Base/EmbedImages.php on line 41

And when i tried to generate in the default format i get this error :

daux generate
Copying Static assets ...                                                                                                                                                                         [  OK  ]
Generating ...
PHP Fatal error:  Uncaught Error: Call to undefined function Todaymade\Daux\utf8_encode() in /home/remi/.config/composer/vendor/daux/daux.io/libs/DauxHelper.php:112
Stack trace:
#0 /home/remi/.config/composer/vendor/daux/daux.io/libs/DauxHelper.php(23): Todaymade\Daux\DauxHelper::getTheme(Object(Todaymade\Daux\Config), '')
#1 /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/HTML/Generator.php(180): Todaymade\Daux\DauxHelper::rebaseConfiguration(Object(Todaymade\Daux\Config), '')
#2 /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/HTML/Generator.php(98): Todaymade\Daux\Format\HTML\Generator->generateRecursive(Object(Todaymade\Daux\Tree\Root), 'static', Object(Todaymade\Daux\Config), Object(Symfony\Component\Console\Output\ConsoleOutput), 204, false)
#3 /home/remi/.config/composer/vendor/daux/daux.io/libs/Console/Generate.php(55): Todaymade\Daux\Format\HTML\Generator->generateAll(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput), 204)
#4 /home/remi/.co in /home/remi/.config/composer/vendor/daux/daux.io/libs/DauxHelper.php on line 112

@onigoetz
Copy link
Contributor

It seems you need the DOM extension for PHP. which version of PHP are you using ?

@remiflament
Copy link
Author

remiflament commented Dec 14, 2017

Yes i changed that. The daux generate command is correctly working.

php -v
PHP 7.0.19-1 (cli) (built: May 11 2017 14:04:47) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.19-1, Copyright (c) 1999-2017, by Zend Technologies

But i still have problems with daux generate --format=html-file :

PHP Notice:  Undefined index: theme in /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/HTML/Template.php on line 31
PHP Warning:  file_get_contents(themes/daux_singlepage/css/main.min.css): failed to open stream: No such file or directory in /home/remi/.config/composer/vendor/daux/daux.io/libs/Format/HTMLFile/Book.p
hp on line 22

I keep watching this,

Thanks a lot,
Rémi

@onigoetz
Copy link
Contributor

I'll have a look at this in the coming days

@onigoetz
Copy link
Contributor

Hello, I'm very sorry for the delay on this issue, I fixed the generation of single-page documentation, it's on the master branch currently and will be released in a few days

@onigoetz onigoetz added bug and removed support labels Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants