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

No sass fix #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ packages
.pub
refreshChromium-1.0.applescript
*.lockSiteGen.iml

# Files and directories created by pub
.dart_tool/
.packages
11 changes: 4 additions & 7 deletions lib/sitegen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'dart:math';

import 'package:intl/intl.dart';
import 'package:args/args.dart';
import 'package:markdown/markdown.dart';
import 'package:where/where.dart';

import 'package:logging/logging.dart';
Expand All @@ -16,7 +17,7 @@ import 'package:validate/validate.dart';

import "package:path/path.dart" as path;
import "package:markdown/markdown.dart" as md;
import "package:mustache/mustache.dart" as mustache;
import "package:reflected_mustache/mustache.dart" as mustache;
import "package:yaml/yaml.dart" as yaml;

import 'package:http_server/http_server.dart';
Expand All @@ -36,11 +37,7 @@ bool _runsOnOSX() => (SysInfo.operatingSystemName == "Mac OS X");
// final _commands = new List<CommandWrapper>();

Future main(List<String> arguments) async {
final Application application = new Application();
final Application application = new Application();

application.run( arguments );
application.run(arguments);
}




9 changes: 7 additions & 2 deletions lib/src/Application.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Application {
_configLogging(config.loglevel);

try {
_testPreconditions(cm);
_testPreconditions(cm, config);

} catch(error) {
stderr.writeln(error.toString());
Expand Down Expand Up @@ -320,7 +320,12 @@ class Application {

// -- private -------------------------------------------------------------

void _testPreconditions(final CommandManager cm) {
void _testPreconditions(final CommandManager cm, final Config config) {
// if not using sass or prefixer, dont check for them being available
if (!config.usesass && !config.useautoprefixer) {
return;
}

if((cm.containsKey(CommandManager.SASS) || cm.containsKey(CommandManager.SASSC))
&& cm.containsKey(CommandManager.AUTOPREFIXER)) {
return;
Expand Down
25 changes: 20 additions & 5 deletions lib/src/Generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ class Generator {
final String block = yamlBlock.join('\n');
final yaml.YamlMap ym = yaml.loadYaml(block);

pageOptions.addAll(ym.map((key,value)
=> MapEntry<String,String>(key.toString(),value.toString())));
pageOptions.addAll(ym.map((key, value) {
if (value is yaml.YamlList) {
return MapEntry<String, yaml.YamlList>(key.toString(), value);
}
if (value is yaml.YamlMap) {
return MapEntry<String, yaml.YamlMap>(key.toString(), value);
}
return MapEntry<String, String>(key.toString(), value.toString());
}));

_resolvePartialsInYamlBlock(partialsDir,pageOptions,config.usemarkdown);

Expand All @@ -89,7 +96,10 @@ class Generator {

String outputExtension = extension;
if (isMarkdown(file) && _isMarkdownSupported(config.usemarkdown, pageOptions)) {
pageOptions['_content'] = md.markdownToHtml(pageOptions['_content']);
pageOptions['_content'] = md.markdownToHtml(pageOptions['_content'],
inlineSyntaxes: [InlineHtmlSyntax()],
extensionSet: ExtensionSet.gitHubWeb
);
outputExtension = "html";
}

Expand Down Expand Up @@ -186,7 +196,10 @@ class Generator {
} else if(partialMd.existsSync()) {
content = partialMd.readAsStringSync();
if(isMarkdownSupported) {
content = md.markdownToHtml(content);
content = md.markdownToHtml(content,
inlineSyntaxes: [InlineHtmlSyntax()],
extensionSet: ExtensionSet.gitHubWeb,
);
}
}

Expand Down Expand Up @@ -239,7 +252,9 @@ class Generator {

file.path.endsWith('.png') ||
file.path.endsWith(".jpg") ||
file.path.endsWith(".gif")
file.path.endsWith(".gif") ||
file.path.endsWith(".woff") ||
file.path.endsWith(".tff")

) && !file.path.contains("packages") )
.map((final FileSystemEntity entity) => entity as File)
Expand Down
Loading