Skip to content

Commit

Permalink
feature: Usage-Sample added
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMitterer committed Mar 3, 2015
1 parent 42b917b commit 951819c
Show file tree
Hide file tree
Showing 20 changed files with 699 additions and 23 deletions.
16 changes: 13 additions & 3 deletions LICENSE
@@ -1,21 +1,31 @@
Copyright (c) 2015, <your name>.
Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
* Neither the name of the Michael Mitterer, IT-Consulting
and Development Limited, Austrian Branch, nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL Michael Mitterer,
IT-Consulting and Development Limited, Austrian Branch, BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
Expand Down
17 changes: 8 additions & 9 deletions Prettify.iml
Expand Up @@ -3,16 +3,15 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/example/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/build/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/build/web/images/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/build/web/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/build/web/styles/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/packages/prettify" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/web/images/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/web/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/theme/web/styles/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/usage/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/usage/build" />
<excludeFolder url="file://$MODULE_DIR$/example/usage/packages/prettify" />
<excludeFolder url="file://$MODULE_DIR$/example/usage/web/images/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/usage/web/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/usage/web/styles/packages" />
<excludeFolder url="file://$MODULE_DIR$/packages/prettify" />
<excludeFolder url="file://$MODULE_DIR$/test/packages" />
</content>
Expand Down
30 changes: 26 additions & 4 deletions README.md
@@ -1,6 +1,6 @@
# prettify

A library for Dart developers. It is awesome.
# prettify - Code prettifier for Dart
Beautify the code snippets in your web page
Based on Googles [google-code-prettify]

## Usage

Expand All @@ -16,4 +16,26 @@ A simple usage example:

Please file feature requests and bugs at the [issue tracker][tracker].

[tracker]: http://example.com/issues/replaceme
###License###

Copyright 2015 Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language
governing permissions and limitations under the License.

If this plugin is helpful for you - please [(Circle)](http://gplus.mikemitterer.at/) me
or **star** this repo here on GitHub

[tracker]: https://github.com/MikeMitterer/dart-prettify/issues
[google-code]: https://code.google.com/p/google-code-prettify/
[usage]:
18 changes: 18 additions & 0 deletions example/index.html
@@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Prettify - Beautify the code snippets in your web page </title>
<meta http-equiv="refresh" content="0;URL=http://prettify.mikemitterer.at/usage/">
</head>
<body bgcolor="#ffffff">
The contents you are looking for have moved. You will be redirected to the new location automatically.
Please bookmark the correct page at <a href="http://prettify.mikemitterer.at/usage/">http://prettify.mikemitterer.at/usage/</a>
<p>Last update: <strong>{{lastupdate}}</strong></p>
</body>
</html>


File renamed without changes.
File renamed without changes.
16 changes: 13 additions & 3 deletions example/theme/LICENSE → example/usage/LICENSE
@@ -1,21 +1,31 @@
Copyright (c) 2015, <your name>.
Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
* Neither the name of the Michael Mitterer, IT-Consulting
and Development Limited, Austrian Branch, nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL Michael Mitterer,
IT-Consulting and Development Limited, Austrian Branch, BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion example/theme/pubspec.yaml → example/usage/pubspec.yaml
@@ -1,4 +1,4 @@
name: 'theme'
name: usage
version: 0.0.1
description: An absolute bare-bones web app.
#author: <your name> <email@example.com>
Expand All @@ -14,3 +14,8 @@ dependencies:

wsk_material: any

logging: any
logging_handlers: any
console_log_handler: any


File renamed without changes
6 changes: 4 additions & 2 deletions example/theme/web/index.html → example/usage/web/index.html
Expand Up @@ -57,10 +57,12 @@
<header id="overview">
<h2>
<strong id="themename">sons-of-obsidian</strong> Theme
<small>for <a target="_blank" href="https://pub.dartlang.org/packages/prettify">Prettify</a>
</small>
<small>for <a target="_blank" href="https://pub.dartlang.org/packages/prettify">Prettify</a></small>
</h2>
<p class="lead">Beautify the code snippets in your web page.</p>
<p>The code for this Dart-Package ist hosted on
<a href="https://github.com/MikeMitterer/dart-prettify" target="_blank">GitHub</a>
</p>

</header>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions gensamples
12 changes: 11 additions & 1 deletion pubspec.yaml
Expand Up @@ -3,10 +3,20 @@ description: Beautify the code snippets in your web page
version: 0.0.1

author: Mike Mitterer <office@mikemitterer.at>
homepage: https://github.com/MikeMitterer/dart-prettify
homepage: http://prettify.mikemitterer.at/

dependencies:
# browser: any

dev_dependencies:
unittest: any

# for the samples
wsk_material: any

logging: any
logging_handlers: any
console_log_handler: any

args: any

119 changes: 119 additions & 0 deletions tools/buildinfolder.sh
@@ -0,0 +1,119 @@
#!/bin/sh

#------------------------------------------------------------------------------
# Little script makes the dart-code more readable.
# Was
# final ProcessResult result = Process.runSync( "sh", [ '-c', '(cd ${folder} && pub build)' ]);
#

FOLDER=$2
if test "${FOLDER}" == ""
then
FOLDER=`pwd`
#elif [ -d ${FOLDER} ]
#then
# echo "$FOLDER does not exist!"
# exit 2
fi

cd ${FOLDER}

#------------------------------------------------------------------------------
# Functions
#

buildCss() {
echo "Running sassc + autoprefixer in `pwd`"

SCSSFOUND=0
ERRORSTATE=1
if [ -e "web/demo.scss" ]
then
echo "sassc demo.scss -> demo.css && autoprefixer demo.css"
sassc "web/demo.scss" "web/demo.css" && autoprefixer "web/demo.css"
ERRORSTATE=$?
SCCSFOUND=1
fi

if [ -e "web/assets/scss/styleguide.scss" ]
then
echo "sassc styleguide.scss -> styleguide.scss && autoprefixer styleguide.scss"
sassc "web/assets/scss/styleguide.scss" "web/assets/css/styleguide.css" && autoprefixer "web/assets/css/styleguide.css"
ERRORSTATE=$?
SCCSFOUND=1
fi

if [ ${SCCSFOUND} -ne 1 ]; then
echo "No SCSS-File found!"
exit 1
fi

if [ ${ERRORSTATE} -ne 0 ]; then
exit ${ERRORSTATE}
fi

}

buildJS() {
echo "Building sample in `pwd`"
# Now - run build
pub build

ERRORSTATE=$?
if [ ${ERRORSTATE} -ne 0 ]; then
exit ${ERRORSTATE}
fi
}

pubUpdate() {
echo "'pub update' in `pwd`"
pub update

ERRORSTATE=$?
if [ ${ERRORSTATE} -ne 0 ]; then
exit ${ERRORSTATE}
fi
}

#------------------------------------------------------------------------------
# Options
#

usage() {
echo
echo "Usage: `basename $0` [ options ] <folder>"
echo " --withcss Calls sassc + autoprefixer and makes a 'pub build'"
echo " --jsonly 'pub build' in `pwd`"
echo " --cssonly Calls sassc + autoprefixer"
echo " --update 'pub build' in `pwd`"
echo
}

case "$1" in
help|-help|--help)
usage
;;

withcss|-withcss|--withcss)
buildCss
buildJS
;;

jsonly|-jsonly|--jsonly)
buildJS
;;

cssonly|-cssonly|--cssonly)
buildCss
;;

update|-update|--update)
pubUpdate
;;

*)
usage
;;

esac
exit 0

0 comments on commit 951819c

Please sign in to comment.