-
Notifications
You must be signed in to change notification settings - Fork 10
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
Proper documentation #10
Comments
I suppose using this platform for documentation. |
I'm not sure how rtfd platform can bring a value for now. |
I guess you are right about the rtfd platform, that would be overkill as this is mostly jade. Yet still we have to document the phpRuntime options, and how functions are called inside tags. Contributing is mainly to keep a consistent quality standard throughout this library: |
Of course, PHP runtime code, extractor code, detailed options and usage should be well documented. |
Meanwhie, would you explain what exactly jade2php generates? Rendering this simple template: doctype html
html(lang!="$language")
head
!=$head using: <?php error_reporting(E_ALL & ~E_NOTICE);function attr($name, $value = true, $escaped = true) {if (!empty($value)) {echo " $name=\"$value\""
;}}function attrs() {$args = func_get_args();$attrs = array();foreach ($args as $arg) {foreach ($arg as $key => $value) {if ($key == 'class'
) {if (!isset($attrs[$key])) $attrs[$key] = array();$attrs[$key] = array_merge($attrs[$key], is_array($value) ? $value : explode(' ', $value
));} else {$attrs[$key] = $value;}}}foreach ($attrs as $key => $value) {if ($key == 'class') {attr_class($value);} else {attr($key, $value);
}}}function attr_class() {$classes = array();$args = func_get_args();foreach ($args as $arg) {if (empty($arg) || is_array($arg) && count($ar
g) == 0) continue;$classes = array_merge($classes, is_array($arg) ? $arg : array($arg));}$classes = array_filter($classes);if (count($classe
s) > 0) attr('class', join(' ', $classes));}function add() {$result = '';$args = func_get_args();$concat = false;foreach ($args as $arg) {if
($concat || is_string($arg)) {$concat = true;$result .= $arg;} elseif (is_numeric($arg)) {if ($result === '') $result = 0;$result += $arg;}
}return $result;}?><!DOCTYPE html><html lang="$language"><head><?= $$head ?></head></html> UPDATE Fixed "--omit-php-runtim" in command line, now the output is much nicer: <!DOCTYPE html><html lang="$language"><head><?= $$head ?></head></html> but still I don't get how to make it look like: <!DOCTYPE html>
<html lang="<?php echo $language?>">
<head>
<?php echo $head ?>
</head>
</html> i.e.:
Thanks in advance! |
1, 2. this is |
@OnkelTem |
Guys, I'm trying to figure out the difference between jade-php and jade2php. @FranzSkuffka |
While writing |
One more important part – |
I might be interested in helping document this. |
@kevindice, you're welcome. Let do this via usual Fork → Pull Request? |
@ivankravchenko I just created http://pug2php.netlify.com/ which is a small demo app. What do you think? @kevindice Are you still interested in creating a documentation? Repo: https://github.com/FranzSkuffka/pug2php-www |
So I'm interested in the gulp plugin.. Unfortunately there is no documentation whatsoever for it (not even a readme.md). Am I able to pass args using gulp? |
Scratch my last... Read through the source file and it looks like the options should be given in camelCase rather than kebab-case... Docs would still be handy though. |
The text was updated successfully, but these errors were encountered: