Skip to content
Merged

0.5.4 #169

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
bc00f42
0.5.4-dev
robhrt7 Jun 10, 2015
703921c
Support folders inside specfile names
dmitryshimkin Jun 10, 2015
924a7bb
Merge pull request #154 from dmitryshimkin/feature/support-folder-in-…
robhrt7 Jun 10, 2015
120b8bc
wrap strollToHash with DOM ready
robhrt7 Jun 11, 2015
e26bcf2
add global level excludeDir for file-tree parser
robhrt7 Jun 15, 2015
7ebba36
Merge branch 'master' into 0.5.4-dev
robhrt7 Jun 18, 2015
3729cee
allow configuration of MD lang-renderers, add extend for re-defined M…
robhrt7 Jun 23, 2015
9e19096
remove `bower_components` folder from ignored by default
robhrt7 Jun 29, 2015
bf03170
Merge remote-tracking branch 'origin/master' into 0.5.4-dev
robhrt7 Jun 29, 2015
1bcee65
replace jsdom with cheerio in wrap.js (with support of raw index.html…
robhrt7 May 19, 2015
2077fa1
removing cheerio hack
robhrt7 May 25, 2015
082e2ac
update cheerio and improve codeFormat for #158
robhrt7 Jul 10, 2015
a95b345
Link to all specs should be similar to header (configurable)
Aug 6, 2015
1bb3e26
jQuery + browser plugin are updated;
Aug 6, 2015
67ae67b
allow deep server configuration #159
robhrt7 Aug 10, 2015
723e5df
return missed `_fileName` definition
robhrt7 Aug 10, 2015
53effbd
fix options merge - don't merge array values
robhrt7 Aug 10, 2015
e4d0bf6
make spec thumbnail configurable #150, refactor fileTree.getSpecMeta
robhrt7 Aug 12, 2015
9687598
update travis conf, following their new infrastructure changes
robhrt7 Aug 12, 2015
7d609a4
remove old ie hooks
robhrt7 Aug 12, 2015
7fa5d80
fix md description wrap
robhrt7 Aug 12, 2015
c84589c
use auto-generated title in doc template #151
robhrt7 Aug 12, 2015
6d0f0c3
utils.extendOptions
robhrt7 Aug 13, 2015
50251b1
middleware loader #117
robhrt7 Aug 13, 2015
7bf551e
allow middleware disabling && error handling
robhrt7 Aug 13, 2015
09b8b3f
utils.extendOptions
robhrt7 Aug 13, 2015
97f8cec
don't load middleware index file if it's disabled
robhrt7 Aug 14, 2015
56b455f
improve options extension in core modules
robhrt7 Aug 14, 2015
476911f
run app in CI with log:trace
robhrt7 Aug 14, 2015
36747e1
clarify: handle error if no info about spec found
robhrt7 Aug 14, 2015
f019b1b
fix numbered list line-height
robhrt7 Aug 14, 2015
e94b49b
missed jquery dependency is changed
Aug 14, 2015
d78ae3e
improving error handling
robhrt7 Aug 14, 2015
c975e33
Merge branch '0.5.4-dev' into opertino/middleware-loader
robhrt7 Aug 14, 2015
6ab7814
Merge pull request #167 from sourcejs/opertino/middleware-loader
robhrt7 Aug 14, 2015
bdec124
add relative paths support to nav generation
robhrt7 Aug 14, 2015
5cd9ec9
Merge pull request #165 from sourcejs/feature/jquery-up
robhrt7 Aug 14, 2015
1e5fcd7
allow running sourcejs without user dir
robhrt7 Aug 14, 2015
61dd935
run tests with trace only in CI
robhrt7 Aug 14, 2015
75f6444
separate ci-test command, because of older npm versions
robhrt7 Aug 14, 2015
f585964
update win-ci conf
robhrt7 Aug 14, 2015
a434bfb
return ps to win-ci
robhrt7 Aug 14, 2015
592ee70
cleaning some karma
robhrt7 Aug 15, 2015
598be8f
improve header-footer rendering, add error handlers
robhrt7 Aug 15, 2015
083b0ea
add version number to doc template
robhrt7 Aug 15, 2015
47c5663
fix code highlight
robhrt7 Aug 15, 2015
9f4bb68
fix footer styles
robhrt7 Aug 15, 2015
1c0c60c
run win-ci without watch because of the bug
robhrt7 Aug 15, 2015
863f566
update docs
robhrt7 Aug 15, 2015
51f633b
fix --html flag
robhrt7 Aug 15, 2015
fc764f5
update version in docs
robhrt7 Aug 15, 2015
dff9d2a
fix app root path for source-as-npm
robhrt7 Aug 15, 2015
c57b471
bump version to 0.5.4
robhrt7 Aug 15, 2015
9336c71
don't repeat options in module
robhrt7 Aug 15, 2015
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: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ node_js:
- "0.10"
- "0.11"
- "0.12"
sudo: false
notifications:
email:
on_success: never
on_failure: always
before_script: "git clone https://github.com/sourcejs/init.git user"
before_script: "git clone https://github.com/sourcejs/init.git user"
script: npm run ci-test
62 changes: 25 additions & 37 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ global.opts = loadOptions();
// Arguments parse */
commander
.option('-l, --log [string]', 'Log level (default: ' + global.opts.core.common.defaultLogLevel + ').', global.opts.core.common.defaultLogLevel)
.option('-p, --port [number]', 'Server port (default: ' + global.opts.core.common.port + ').', global.opts.core.common.port)
.option('-p, --port [number]', 'Server port (default: ' + global.opts.core.server.port + ').')
.option('--hostname [string]', 'Server hostname (default: ' + global.opts.core.server.hostname + ').')
.option('--html', 'Turn on HTML parser on app start (requires installed and enabled parser).')
.option('--test', 'Run app with tests.')
.option('--no-watch', 'Run with disabled watcher.')
.parse(process.argv);

global.commander = commander;
Expand All @@ -48,8 +50,13 @@ var logger = require('./core/logger');
var log = logger.log;
global.log = log;

if (commander.html) global.opts.core.parseHTML.onStart = true;
if (commander.port) global.opts.core.common.port = parseInt(commander.port);
if (commander.html) {
global.opts.plugins.htmlParser.enabled = true;
global.opts.plugins.htmlParser.onStart = true;
}
if (commander.port) global.opts.core.server.port = parseInt(commander.port);
if (commander.hostname) global.opts.core.server.hostname = commander.hostname;
if (!commander.watch) global.opts.core.watch.enabled = false;
/* /Globals */


Expand Down Expand Up @@ -97,14 +104,15 @@ app.use(bodyParser.json());



/* Middlewares */
/* Includes */

// Middlewares
require('./core/middlewares/loader').process(app, global.opts);

// Auth initializing
var auth = require('./core/auth')(app);
app.use(auth.everyauth.middleware());

// Clarify
app.use(require('./core/middleware/clarify'));

// File tree module
var fileTree = require('./core/file-tree');
Expand Down Expand Up @@ -133,29 +141,6 @@ app.use('/api/updateFileTree', function(req, res){
});


// Middleware that loads spec content
var read = require("./core/middleware/read");
app.use(read.process);

// Markdown
app.use(require("./core/middleware/md").process);
app.use(require("./core/middleware/mdTag").process);

// Load user defined middleware, that processes spec content
require("./core/middleware/userMiddleware");

// Middleware that wraps spec with Source template
app.use(require("./core/middleware/wrap").process);

// Middleware that sends final spec response
app.use(require("./core/middleware/send").process);

/* /Middlewares */



/* Includes */

// Routes
require('./core/routes');

Expand Down Expand Up @@ -194,15 +179,18 @@ app.use(express.static(app.get('user')));

// Page 404
app.use(function(req, res){

if (req.accepts('html')) {
if (req.url === '/') {
res.redirect('/docs');
return;
}

var headerFooterHTML = headerFooter.getHeaderAndFooter();
res.status(404).render(path.join(__dirname, '/core/views/404.ejs'), {
header: headerFooterHTML.header,
footer: headerFooterHTML.footer
});
}

});
/* /Serving content */

Expand Down Expand Up @@ -231,14 +219,13 @@ app.use(logErrors);



// Server start
/* Server start */
if (!module.parent) {
var port = global.opts.core.common.port;

app.listen(port);
var portString = port.toString();
var serverOpts = global.opts.core.server;
var port = serverOpts.port;

log.info('[SOURCEJS] launched on http://127.0.0.1:'.blue + portString.red + ' in '.blue + MODE.blue + ' mode...'.blue);
app.listen(port, serverOpts.hostname, serverOpts.backlog, serverOpts.callback);
log.info('[SOURCEJS] launched on http://127.0.0.1:'.blue + (port.toString()).red + ' in '.blue + MODE.blue + ' mode...'.blue);

if (commander.test) {
var spawn = require('cross-spawn');
Expand All @@ -255,3 +242,4 @@ if (!module.parent) {
});
}
}
/* Server start */
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ build: off
before_test: "git clone https://github.com/sourcejs/init.git user"

test_script:
# Output useful info for debugging.
- node --version && npm --version
- ps: "npm test # PowerShell" # Pass comment to PS for easier debugging
- cmd: npm test
- ps: "npm run ci-test # PowerShell" # Pass comment to PS for easier debugging
- cmd: "npm run ci-test-nw" # Run without watch because of CI bug

matrix:
fast_finish: true
Expand Down
4 changes: 4 additions & 0 deletions assets/css/cosmetic/highlights.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
.source_code;
});

.source-main-only(code,{
.source_code;
});

.lang-source_wide-code {
padding: 10px !important;
font-size: @fz-size-xs !important;
Expand Down
17 changes: 0 additions & 17 deletions assets/css/cosmetic/links.less
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,5 @@
}
}

/* fallback for ie which not support SVG */
.ie8 {
.source_a_d { /* Design link */

&:before {
background-image: url(/source/assets/i/spec_design_link.png);
}
}

.source_a_s { /* Spec link */

&:before {
background-image: url(/source/assets/i/spec_link.png);
}
}
}

/* /Links
---------------------------------------------------------------------------------- */
1 change: 1 addition & 0 deletions assets/css/project/footer.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
}

.source_footer h2 {
.reset();
margin-bottom: 10px;
font-weight: normal;
font-size: 15px;
Expand Down
9 changes: 8 additions & 1 deletion assets/css/project/layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
margin-bottom: 40px;

flex: 1;
-ms-flex: none; /* ie fucks up */
-ms-flex: none;

width: 100%;
box-sizing: border-box;
Expand Down Expand Up @@ -69,6 +69,13 @@
color: @black;
}

.source_header-meta {
font-size: @fz-size-xs !important;
line-height: 1.2 !important;
color: @color-aux;
margin-bottom: 20px;
}

.source-main-only(h1,{
.source_main_h1;
});
Expand Down
8 changes: 0 additions & 8 deletions assets/css/project/section.less
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,6 @@
body & > h2:first-child { //body for weihgt
display: block;
}

.ie9 & > *:not(.source_example) {
display: block;
}

.ie9 .source_example {
display: inline-block !important;
}
}

.source_section__open {
Expand Down
2 changes: 2 additions & 0 deletions assets/css/reset.less
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ body {
});

.source-only(ol li,{
font-size: @fz-size-m;
line-height: 1.5;
list-style: decimal inside !important;
});

Expand Down
4 changes: 2 additions & 2 deletions assets/js/_require.bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"{%= grunt.file.read('assets/js/lib/require.js') %}"
"{%= grunt.file.read('assets/js/lib/jquery-1.11.1.js') %}"
"{%= grunt.file.read('assets/js/lib/jquery-2.1.4.min.js') %}"
"{%= grunt.file.read('assets/js/require-config.js') %}"

// Extending base js config with npm packages list
Expand All @@ -19,4 +19,4 @@ requirejs.config({

return npmPackages;
}()
});
});
4 changes: 3 additions & 1 deletion assets/js/lib/codeFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ define([
;

var indentCode = function (line) {
return new Array(tabs + 1).join(' ') + line;
var _tabs = tabs < 0 ? 0 : tabs;

return new Array(_tabs + 1).join(' ') + line;
};

if (code.length > 0) {
Expand Down
Loading