From 2a585945dab1cdbd8ebdd4462b0b09e9eaf89fea Mon Sep 17 00:00:00 2001 From: Laurin Quast Date: Fri, 7 Dec 2018 15:09:06 +0100 Subject: [PATCH] docs(readme): highlight code example --- README.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 119df351..32edcdd9 100644 --- a/README.md +++ b/README.md @@ -29,21 +29,23 @@ Allows you to edit xcodeproject files and write them back out. ## Example - // API is a bit wonky right now - var xcode = require('xcode'), - fs = require('fs'), - projectPath = 'myproject.xcodeproj/project.pbxproj', - myProj = xcode.project(projectPath); +```js +// API is a bit wonky right now +var xcode = require('xcode'), + fs = require('fs'), + projectPath = 'myproject.xcodeproj/project.pbxproj', + myProj = xcode.project(projectPath); - // parsing is async, in a different process - myProj.parse(function (err) { - myProj.addHeaderFile('foo.h'); - myProj.addSourceFile('foo.m'); - myProj.addFramework('FooKit.framework'); - - fs.writeFileSync(projectPath, myProj.writeSync()); - console.log('new project written'); - }); +// parsing is async, in a different process +myProj.parse(function (err) { + myProj.addHeaderFile('foo.h'); + myProj.addSourceFile('foo.m'); + myProj.addFramework('FooKit.framework'); + + fs.writeFileSync(projectPath, myProj.writeSync()); + console.log('new project written'); +}); +``` ## Working on the parser