diff --git a/README.md b/README.md index 69f8d83..3e30497 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ * 100% Mobile responsive * Supports GitHub Flavored Markdown +* Auto created homepage/landing page * Auto Syntax Highlighting * Auto Generated Navigation * 4 Built-In Themes or roll your own @@ -19,7 +20,7 @@ This is a list of sites using Daux.io: * [TodayCMS Docs](http://docs.todaymade.com) -Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/tm-docs/issues) and I will add you to the list. +Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/daux.io/issues) and I will add you to the list. ## Download @@ -88,7 +89,7 @@ We have 4 built-in Bootstrap themes. To use one of the themes, just set the `the To create a custom color scheme, set the `theme` property to `custom` and then define the required colors. Copy the following configuration to get started: { - "theme": "custom" + "theme": "custom", "colors": { "sidebar-background": "#f7f7f7", "sidebar-hover": "#c5c5cb", @@ -115,7 +116,7 @@ By deafult your code blocks will be floated to a column on the right side of you Add a 'Fork me on Github' ribbon. { - "repo": "justinwalsh/tm-docs" + "repo": "justinwalsh/daux.io" } ###Twitter: @@ -130,9 +131,9 @@ Include custom links in the sidebar. { "links": { - "Github Repo": "https://github.com/justinwalsh/tm-docs", - "Help/Support/Bugs": "https://github.com/justinwalsh/tm-docs/issues", - "Todaymade": "http://todaymade.com" + "Github Repo": "https://github.com/justinwalsh/daux.io", + "Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues", + "Made by Todaymade": "http://todaymade.com" } } @@ -151,4 +152,4 @@ This project contains a package.json file, so once you have the requirements ins ## Support -If you need help using Daux.io, or have found a bug, please create an issue on the Github repo. \ No newline at end of file +If you need help using Daux.io, or have found a bug, please create an issue on the Github repo. \ No newline at end of file diff --git a/docs/00_Getting_Started.md b/docs/00_Getting_Started.md index ee4b914..cd7815e 100644 --- a/docs/00_Getting_Started.md +++ b/docs/00_Getting_Started.md @@ -20,7 +20,7 @@ This is a list of sites using Daux.io: * [TodayCMS Docs](http://docs.todaymade.com) -Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/tm-docs/issues) and I will add you to the list. +Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/daux.io/issues) and I will add you to the list. ## Download @@ -48,7 +48,6 @@ You must use the `.md` file extension for your files. Also, you must use undersc * File Name With Space.md = FAIL - ## Sorting To sort your files and folders in a specific way, you can prefix them with a number and underscore, e.g. `/docs/01_Hello_World.md` and `/docs/05_Features.md` This will list *Hello World* before *Features*, overriding the deafult alpha-numeric sorting. The numbers will be stripped out of the navigation and urls. @@ -116,7 +115,7 @@ By deafult your code blocks will be floated to a column on the right side of you Add a 'Fork me on Github' ribbon. { - "repo": "justinwalsh/tm-docs" + "repo": "justinwalsh/daux.io" } ###Twitter: @@ -131,9 +130,9 @@ Include custom links in the sidebar. { "links": { - "Github Repo": "https://github.com/justinwalsh/tm-docs", - "Help/Support/Bugs": "https://github.com/justinwalsh/tm-docs/issues", - "Todaymade": "http://todaymade.com" + "Github Repo": "https://github.com/justinwalsh/daux.io", + "Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues", + "Made by Todaymade": "http://todaymade.com" } } @@ -152,4 +151,4 @@ This project contains a package.json file, so once you have the requirements ins ## Support -If you need help using Daux.io, or have found a bug, please create an issue on the Github repo. \ No newline at end of file +If you need help using Daux.io, or have found a bug, please create an issue on the Github repo. \ No newline at end of file diff --git a/docs/01_API/05_Example_Config.md b/docs/01_API/05_Example_Config.md deleted file mode 100644 index a1f0ebc..0000000 --- a/docs/01_API/05_Example_Config.md +++ /dev/null @@ -1,31 +0,0 @@ -The following collection config will be used as the config throughout the example calls in this guide. - - { - "team": { - "title": "Team Members", - "type": "multiple", - "fields": { - "name": { - "title": "Name", - "type": "text" - }, - "employment": { - "title": "Employment Status", - "type": "select", - "options": { - "half": "Part Time", - "full": "Full Time", - "retired": "Retired" - } - }, - "bio": { - "title": "Bio", - "type": "textarea" - }, - "address": { - "title": "Home Address", - "type": "location" - } - } - } - } \ No newline at end of file diff --git a/docs/01_API/10_Create.md b/docs/01_API/10_Create.md deleted file mode 100644 index b3fcc59..0000000 --- a/docs/01_API/10_Create.md +++ /dev/null @@ -1,25 +0,0 @@ -To create an object in a collection, issue a HTTP POST call with the object in the body of the POST. - - POST /collections/:collection - -**URL Parameters** - -`:collection` is the key of the collection in the config. - -**Example** - - POST /collections/team - - name = Justin - employment = full - bio = Node.js developer - address[city] = Bismarck - address[state] = ND - address[zip] = 58501 - ... - -Note: 'team' is the key used in our example config at the top of this guide - -**Returns** - -The object you just created. \ No newline at end of file diff --git a/docs/01_API/15_Read.md b/docs/01_API/15_Read.md deleted file mode 100644 index 617a961..0000000 --- a/docs/01_API/15_Read.md +++ /dev/null @@ -1,12 +0,0 @@ -To read from a collection, issue a HTTP GET call - - GET /collections/:collection - - -**URL Parameters** - -`:collection` is the key of the collection in the config. - -**Returns** - -An array of objects from the collection. \ No newline at end of file diff --git a/docs/01_API/20_Update.md b/docs/01_API/20_Update.md deleted file mode 100644 index 8b77c39..0000000 --- a/docs/01_API/20_Update.md +++ /dev/null @@ -1,18 +0,0 @@ -To update an object in a collection, issue a HTTP POST call with the object in the body of the POST. - - POST /collections/:collection/:id - - name = Justin Walsh - employment = part - bio = Documention writer - ... - -**URL Parameters** - -`:collection` is the key of the collection in the config. - -`:id` is the id of the object you want to update. - -**Returns** - -The object you just updated. \ No newline at end of file diff --git a/docs/01_API/25_Delete.md b/docs/01_API/25_Delete.md deleted file mode 100644 index ca69ef1..0000000 --- a/docs/01_API/25_Delete.md +++ /dev/null @@ -1 +0,0 @@ -Coming Soon \ No newline at end of file diff --git a/docs/01_Examples/01_GitHub_Flavored_Markdown.md b/docs/01_Examples/01_GitHub_Flavored_Markdown.md new file mode 100644 index 0000000..6152842 --- /dev/null +++ b/docs/01_Examples/01_GitHub_Flavored_Markdown.md @@ -0,0 +1,156 @@ +Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character: + +Roses are red +Violets are blue + +The next paragraph has the same phrases, but now they are separated by two spaces and a newline character: + +Roses are red +Violets are blue + +Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing. + +A bit of the GitHub spice +------------------------- + +In addition to the changes in the previous section, certain references are auto-linked: + +* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 +* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 +* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 +* \#Num: #1 +* User/#Num: mojombo#1 +* User/Project#Num: mojombo/god#1 + +These are dangerous goodies though, and we need to make sure email addresses don't get mangled: + +My email addy is tom@github.com. + +Math is hard, let's go shopping +------------------------------- + +In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7. + +Triangles man! a^2 + b^2 = c^2 + +We all like making lists +------------------------ + +The above header should be an H2 tag. Now, for a list of fruits: + +* Red Apples +* Purple Grapes +* Green Kiwifruits + +Let's get crazy: + +1. This is a list item with two paragraphs. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. Aliquam hendrerit + mi posuere lectus. + + Vestibulum enim wisi, viverra nec, fringilla in, laoreet + vitae, risus. Donec sit amet nisl. Aliquam semper ipsum + sit amet velit. + +2. Suspendisse id sem consectetuer libero luctus adipiscing. + +What about some code **in** a list? That's insane, right? + +1. In Ruby you can map like this: + + ['a', 'b'].map { |x| x.uppercase } + +2. In Rails, you can do a shortcut: + + ['a', 'b'].map(&:uppercase) + +Some people seem to like definition lists + +
+
Lower cost
+
The new version of this product costs significantly less than the previous one!
+
Easier to use
+
We've changed the product so that it's much easier to use!
+
+ +I am a robot +------------ + +Maybe you want to print `robot` to the console 1000 times. Why not? + + def robot_invasion + puts("robot " * 1000) + end + +You see, that was formatted as code because it's been indented by four spaces. + +How about we throw some angle braces and ampersands in there? + + + +Set in stone +------------ + +Preformatted blocks are useful for ASCII art: + +
+             ,-.
+    ,     ,-.   ,-.
+   / \   (   )-(   )
+   \ |  ,.>-(   )-<
+    \|,' (   )-(   )
+     Y ___`-'   `-'
+     |/__/   `-'
+     |
+     |
+     |    -hrr-
+  ___|_____________
+
+ +Playing the blame game +---------------------- + +If you need to blame someone, the best way to do so is by quoting them: + +> I, at any rate, am convinced that He does not throw dice. + +Or perhaps someone a little less eloquent: + +> I wish you'd have given me this written question ahead of time so I +> could plan for it... I'm sure something will pop into my head here in +> the midst of this press conference, with all the pressure of trying to +> come up with answer, but it hadn't yet... +> +> I don't want to sound like +> I have made no mistakes. I'm confident I have. I just haven't - you +> just put me under the spot here, and maybe I'm not as quick on my feet +> as I should be in coming up with one. + +Table for two +------------- + + + + + + + + + + + +
IDNameRank
1Tom Preston-WernerAwesome
2Albert EinsteinNearly as awesome
+ +Crazy linking action +-------------------- + +I get 10 times more traffic from [Google] [1] than from +[Yahoo] [2] or [MSN] [3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +*View the [source of this content](http://github.github.com/github-flavored-markdown/sample_content.html).* \ No newline at end of file diff --git a/docs/06_Highlight_Samples/highlight-js.md b/docs/01_Examples/05_Code_Highlighting.md similarity index 100% rename from docs/06_Highlight_Samples/highlight-js.md rename to docs/01_Examples/05_Code_Highlighting.md diff --git a/docs/02_Config/01_Parent.md b/docs/02_Config/01_Parent.md deleted file mode 100644 index 100ab24..0000000 --- a/docs/02_Config/01_Parent.md +++ /dev/null @@ -1,41 +0,0 @@ -A config object that contains other objects (admin sections) and displays them in a group. - -Parent elements are characterized by a subhead in the admin panel navigation. They also group elements in the [[Outline (call)]]. - - { - "sample_parent": { - "title": "Sample Parent", - "type": "parent" - } - } - -**Parameters** - -| Name | Default | Description | -| :------------- | :------------- | :------------- | -| title | required | Descriptive title of the object. This value will be used to identify the object in the admin panel sidebar navigation. Required field. | -| type | parent | Object identifier. Required, must be set to: 'parent' | - -### Single -The Single object is created in the config.json file. This will create a single page that can be edited in the admin panel and displayed on the front end. - - { - "single-name": { - "title": "single-title", - "parent": "sample_parent", - "type": "single", - "fields": { - - } - } - } - -**Parameters** - -| Name | Default | Description | -| :------------- | :------------- | :------------- | -| title | required | Descriptive title of the page. This value will be used to identify the object in the admin panel sidebar navigation. Required field. | -| type | single | Object identifier. Required, must be set to: 'single.' | -| parent | - | Defines parent container object. Allows you to group multiple objects together in the admin panel (like a folder). | -| nav | true | Allows you to hide or show object elements in the admin panel. | - diff --git a/docs/03_Editor/05_Setup.md b/docs/03_Editor/05_Setup.md deleted file mode 100644 index 3bf05d0..0000000 --- a/docs/03_Editor/05_Setup.md +++ /dev/null @@ -1,99 +0,0 @@ -There are several customizations that can be made to the 'cms_setup' function. - -##id -Used to update an existing record. - - - -##config -Overrides the collections configuration for only this editor. - -In this example we are changing the visibility of the account field: - - - -##data -Overrides the data for this object - - - -##before_save -Function that is called before the object is saved to the api. It recieves a complete json copy of the object. Use this to make any modifications to the object before it is saved. If you return false, the save will be canceled, this is usefully for valdation errors. - - - -##after_save -Function that is called after the object has been saved. It recieves a complete json copy of the object that was just saved to the database. - - - -##bootstrap -Enable or disable the bootstrap css. Useful if bootstrap has already been loaded on the page. - - - -##theme -Sets the theme. Availible themes: light or dark. The light theme is the default. Use false to disable the theme css. - - diff --git a/docs/05_Example_Folder/01_Sample_Page.md b/docs/05_Example_Folder/01_Sample_Page.md deleted file mode 100644 index 31e517b..0000000 --- a/docs/05_Example_Folder/01_Sample_Page.md +++ /dev/null @@ -1,3 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa. Nulla accumsan malesuada nibh, id scelerisque tortor hendrerit ut. Curabitur tellus odio, fringilla at laoreet ac, ullamcorper non diam. Vestibulum faucibus, mauris at iaculis lacinia, ante tellus aliquam dui, eu aliquet lectus nulla sed mi. Aliquam eu felis sed orci aliquam gravida. - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa. \ No newline at end of file diff --git a/docs/05_Example_Folder/05_Hello_World.md b/docs/05_Example_Folder/05_Hello_World.md deleted file mode 100644 index 0bbe6e3..0000000 --- a/docs/05_Example_Folder/05_Hello_World.md +++ /dev/null @@ -1,5 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa. - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa. Nulla accumsan malesuada nibh, id scelerisque tortor hendrerit ut. Curabitur tellus odio, fringilla at laoreet ac, ullamcorper non diam. Vestibulum faucibus, mauris at iaculis lacinia, ante tellus aliquam dui, eu aliquet lectus nulla sed mi. Aliquam eu felis sed orci aliquam gravida. Ut aliquam velit commodo mauris molestie in accumsan lacus iaculis. Pellentesque at sodales leo. - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa. Nulla accumsan malesuada nibh, id scelerisque tortor hendrerit ut. Curabitur tellus odio, fringilla at laoreet ac, ullamcorper non diam. Vestibulum faucibus, mauris at iaculis lacinia, ante tellus aliquam dui, eu aliquet lectus nulla sed mi. Aliquam eu felis sed orci aliquam gravida. \ No newline at end of file diff --git a/docs/05_More_Examples/Hello_World.md b/docs/05_More_Examples/Hello_World.md new file mode 100644 index 0000000..5cd07c4 --- /dev/null +++ b/docs/05_More_Examples/Hello_World.md @@ -0,0 +1 @@ +THis is just another sample page to get you started. \ No newline at end of file diff --git a/tmdocs/00_Getting_Started.md b/docs/cms/00_Getting_Started.md similarity index 100% rename from tmdocs/00_Getting_Started.md rename to docs/cms/00_Getting_Started.md diff --git a/docs/cms/01_API/00_Overview.md b/docs/cms/01_API/00_Overview.md new file mode 100644 index 0000000..45b99e3 --- /dev/null +++ b/docs/cms/01_API/00_Overview.md @@ -0,0 +1,15 @@ +## Introduction + +:TODO + +## Architecture + +:TODO + +## Formatting + +:TODO + +## Requests and Responses + +:TODO \ No newline at end of file diff --git a/docs/01_API/01_Authentication.md b/docs/cms/01_API/01_Authentication.md similarity index 100% rename from docs/01_API/01_Authentication.md rename to docs/cms/01_API/01_Authentication.md diff --git a/tmdocs/01_API/05_Example_Config.md b/docs/cms/01_API/05_Example_Config.md similarity index 90% rename from tmdocs/01_API/05_Example_Config.md rename to docs/cms/01_API/05_Example_Config.md index a1f0ebc..9c7c622 100644 --- a/tmdocs/01_API/05_Example_Config.md +++ b/docs/cms/01_API/05_Example_Config.md @@ -18,6 +18,10 @@ The following collection config will be used as the config throughout the exampl "retired": "Retired" } }, + "age": { + "title": "Age", + "type": "text" + }, "bio": { "title": "Bio", "type": "textarea" diff --git a/tmdocs/01_API/10_Create.md b/docs/cms/01_API/10_Create.md similarity index 85% rename from tmdocs/01_API/10_Create.md rename to docs/cms/01_API/10_Create.md index b3fcc59..debe75d 100644 --- a/tmdocs/01_API/10_Create.md +++ b/docs/cms/01_API/10_Create.md @@ -2,11 +2,11 @@ To create an object in a collection, issue a HTTP POST call with the object in t POST /collections/:collection -**URL Parameters** +##URL Parameters `:collection` is the key of the collection in the config. -**Example** +##Example POST /collections/team @@ -20,6 +20,6 @@ To create an object in a collection, issue a HTTP POST call with the object in t Note: 'team' is the key used in our example config at the top of this guide -**Returns** +##Returns The object you just created. \ No newline at end of file diff --git a/docs/cms/01_API/15_Read.md b/docs/cms/01_API/15_Read.md new file mode 100644 index 0000000..a8f40fc --- /dev/null +++ b/docs/cms/01_API/15_Read.md @@ -0,0 +1,54 @@ +To read all objects from a collection, issue a HTTP GET call + +Entire Collection: + + GET /collections/:collection + +Single Object: + + GET /collections/:collection/:id + + +### URL Parameters + +`:collection` is the key of the collection in the config. +`:id` [optional]: is the id of an object in the collection. + +### Query Parameters + +All query parameters are optional. + +| Parameter | Type | Description | +| --- | --- | --- | +| `slug` | String | Find record with the matching slug | +| `filter` | JSON Object | Filters the results - [Read More about Filtering](/API/Filtering) | +| `sort` | JSON Object | Sorts the results - [Read More about Sorting](/API/Sorting) | +| `limit` | Integer | Limit the number of results | +| `offset` | Integer | Offset the results | +| `count` | Boolean | Returns the count of matching records | + +### Paging + +To page the results, use the `limit` and `offset` parameters together. For example, if you wanted to page your results 20 at a time and you want the 3rd page of results, you would make the following call: + + GET /collections/:collection?limit=20&offset=40 + +This would return results 41-60 from your collection + +### Count + +To only recieve the number of results that match the get request, you can send the optional `count` paramenter. This is helpful for finding the number of matches for a filter, or other types of linear data. + +Example Call: + + GET /collections/:collection?count=true + +Returns: + + { + "count": 47 + } + +### Returns + +An array of objects from the collection. \ No newline at end of file diff --git a/docs/cms/01_API/20_Update.md b/docs/cms/01_API/20_Update.md new file mode 100644 index 0000000..35ee72b --- /dev/null +++ b/docs/cms/01_API/20_Update.md @@ -0,0 +1,27 @@ +To update an object in a collection, issue a HTTP `PUT` call with the object in the body of the POST. + + PUT /collections/:collection/:id + + name = Justin Walsh + employment = part + bio = Documention writer + ... + +### URL Parameters + +`:collection` is the key of the collection in the config. + +`:id` is the id of the object you want to update. + + +### Query Parameters + +All query parameters are optional. + +| Parameter | Type | Default | Description | +| --- | --- | --- | --- | +| `overwrite` | Boolean | `false` | Setting this to `true` will force the server to completely overwrite the object in the database instead of doing a partial update | + +### Returns + +The object you just updated. \ No newline at end of file diff --git a/docs/cms/01_API/25_Delete.md b/docs/cms/01_API/25_Delete.md new file mode 100644 index 0000000..ac01e12 --- /dev/null +++ b/docs/cms/01_API/25_Delete.md @@ -0,0 +1,13 @@ +To delete an object in a collection, issue a HTTP `DELETE` call with the id of the object you wish to delete in the url. + + DELETE /collections/:collection/:id + +**URL Parameters** + +`:collection` is the key of the collection in the config. + +`:id` is the id of the object you want to delete. + +**Returns** + +The object you just deleted. \ No newline at end of file diff --git a/docs/01_API/30_Filtering.md b/docs/cms/01_API/30_Filtering.md similarity index 100% rename from docs/01_API/30_Filtering.md rename to docs/cms/01_API/30_Filtering.md diff --git a/docs/cms/01_API/35_Sorting.md b/docs/cms/01_API/35_Sorting.md new file mode 100644 index 0000000..0d5e988 --- /dev/null +++ b/docs/cms/01_API/35_Sorting.md @@ -0,0 +1,28 @@ +To filter an api call, send the optional `sort` parameter. The sort parameter is a structured json object. + +## Structure + +The sort object is a simple `{"key": "direction"}` json object. The key is the field you wish to sort by. The direction is which order to sort the field by. The only two values you can use for the direction are `asc` and `desc`. + + { + "field_key": "direction" + } + +*Example Call:* + + GET /collections/team?sort={"name":"asc"} + +## Multiple Fields + +This structure allows you to sort by more then one field at a time. + + { + "field key": "direction", + "field key 2": "direction", + "field key 2": "direction" + ... + } + +*Example Call:* + + GET /collections/team?sort={"age":"desc", "name":"asc"} \ No newline at end of file diff --git a/docs/cms/05_Config/01_Parent.md b/docs/cms/05_Config/01_Parent.md new file mode 100644 index 0000000..2f12b8c --- /dev/null +++ b/docs/cms/05_Config/01_Parent.md @@ -0,0 +1,17 @@ +A config object that contains other objects (admin sections) and displays them in a group. + +Parent elements are characterized by a subhead in the admin panel navigation. They also group elements in the [[Outline (call)]]. + + { + "sample_parent": { + "title": "Sample Parent", + "type": "parent" + } + } + +**Parameters** + +| Name | Default | Description | +| :------------- | :------------- | :------------- | +| title | required | Descriptive title of the object. This value will be used to identify the object in the admin panel sidebar navigation. Required field. | +| type | parent | Object identifier. Required, must be set to: 'parent' | \ No newline at end of file diff --git a/docs/02_Config/05_Single.md b/docs/cms/05_Config/05_Single.md similarity index 100% rename from docs/02_Config/05_Single.md rename to docs/cms/05_Config/05_Single.md diff --git a/docs/02_Config/10_Mutiple.md b/docs/cms/05_Config/10_Mutiple.md similarity index 100% rename from docs/02_Config/10_Mutiple.md rename to docs/cms/05_Config/10_Mutiple.md diff --git a/docs/02_Config/15_Fields/Colorpicker.md b/docs/cms/05_Config/15_Fields/Colorpicker.md similarity index 100% rename from docs/02_Config/15_Fields/Colorpicker.md rename to docs/cms/05_Config/15_Fields/Colorpicker.md diff --git a/docs/02_Config/15_Fields/Date.md b/docs/cms/05_Config/15_Fields/Date.md similarity index 100% rename from docs/02_Config/15_Fields/Date.md rename to docs/cms/05_Config/15_Fields/Date.md diff --git a/docs/02_Config/15_Fields/Datetime.md b/docs/cms/05_Config/15_Fields/Datetime.md similarity index 100% rename from docs/02_Config/15_Fields/Datetime.md rename to docs/cms/05_Config/15_Fields/Datetime.md diff --git a/docs/02_Config/15_Fields/Divider.md b/docs/cms/05_Config/15_Fields/Divider.md similarity index 100% rename from docs/02_Config/15_Fields/Divider.md rename to docs/cms/05_Config/15_Fields/Divider.md diff --git a/docs/02_Config/15_Fields/File.md b/docs/cms/05_Config/15_Fields/File.md similarity index 100% rename from docs/02_Config/15_Fields/File.md rename to docs/cms/05_Config/15_Fields/File.md diff --git a/docs/02_Config/15_Fields/Files.md b/docs/cms/05_Config/15_Fields/Files.md similarity index 100% rename from docs/02_Config/15_Fields/Files.md rename to docs/cms/05_Config/15_Fields/Files.md diff --git a/docs/02_Config/15_Fields/Form.md b/docs/cms/05_Config/15_Fields/Form.md similarity index 100% rename from docs/02_Config/15_Fields/Form.md rename to docs/cms/05_Config/15_Fields/Form.md diff --git a/docs/02_Config/15_Fields/Hidden.md b/docs/cms/05_Config/15_Fields/Hidden.md similarity index 100% rename from docs/02_Config/15_Fields/Hidden.md rename to docs/cms/05_Config/15_Fields/Hidden.md diff --git a/docs/02_Config/15_Fields/Image.md b/docs/cms/05_Config/15_Fields/Image.md similarity index 100% rename from docs/02_Config/15_Fields/Image.md rename to docs/cms/05_Config/15_Fields/Image.md diff --git a/docs/02_Config/15_Fields/Images.md b/docs/cms/05_Config/15_Fields/Images.md similarity index 100% rename from docs/02_Config/15_Fields/Images.md rename to docs/cms/05_Config/15_Fields/Images.md diff --git a/docs/02_Config/15_Fields/Markitup.md b/docs/cms/05_Config/15_Fields/Markitup.md similarity index 100% rename from docs/02_Config/15_Fields/Markitup.md rename to docs/cms/05_Config/15_Fields/Markitup.md diff --git a/docs/02_Config/15_Fields/Multi.md b/docs/cms/05_Config/15_Fields/Multi.md similarity index 100% rename from docs/02_Config/15_Fields/Multi.md rename to docs/cms/05_Config/15_Fields/Multi.md diff --git a/docs/02_Config/15_Fields/Multiselect.md b/docs/cms/05_Config/15_Fields/Multiselect.md similarity index 100% rename from docs/02_Config/15_Fields/Multiselect.md rename to docs/cms/05_Config/15_Fields/Multiselect.md diff --git a/docs/02_Config/15_Fields/Password.md b/docs/cms/05_Config/15_Fields/Password.md similarity index 100% rename from docs/02_Config/15_Fields/Password.md rename to docs/cms/05_Config/15_Fields/Password.md diff --git a/docs/02_Config/15_Fields/Select.md b/docs/cms/05_Config/15_Fields/Select.md similarity index 100% rename from docs/02_Config/15_Fields/Select.md rename to docs/cms/05_Config/15_Fields/Select.md diff --git a/docs/02_Config/15_Fields/Text.md b/docs/cms/05_Config/15_Fields/Text.md similarity index 100% rename from docs/02_Config/15_Fields/Text.md rename to docs/cms/05_Config/15_Fields/Text.md diff --git a/docs/02_Config/15_Fields/Textarea.md b/docs/cms/05_Config/15_Fields/Textarea.md similarity index 100% rename from docs/02_Config/15_Fields/Textarea.md rename to docs/cms/05_Config/15_Fields/Textarea.md diff --git a/docs/02_Config/15_Fields/Wysiwyg.md b/docs/cms/05_Config/15_Fields/Wysiwyg.md similarity index 100% rename from docs/02_Config/15_Fields/Wysiwyg.md rename to docs/cms/05_Config/15_Fields/Wysiwyg.md diff --git a/docs/03_Editor/01_Install.md b/docs/cms/10_Editor/01_Install.md similarity index 100% rename from docs/03_Editor/01_Install.md rename to docs/cms/10_Editor/01_Install.md diff --git a/tmdocs/10_Editor/05_Setup.md b/docs/cms/10_Editor/05_Setup.md similarity index 58% rename from tmdocs/10_Editor/05_Setup.md rename to docs/cms/10_Editor/05_Setup.md index 3bf05d0..feb7f40 100644 --- a/tmdocs/10_Editor/05_Setup.md +++ b/docs/cms/10_Editor/05_Setup.md @@ -43,36 +43,8 @@ Overrides the data for this object }); -##before_save -Function that is called before the object is saved to the api. It recieves a complete json copy of the object. Use this to make any modifications to the object before it is saved. If you return false, the save will be canceled, this is usefully for valdation errors. - - - -##after_save -Function that is called after the object has been saved. It recieves a complete json copy of the object that was just saved to the database. - - +##callbacks +[Learn more](/Editor/Callbacks) about callbacks you can use to hook into the processing of the editor. ##bootstrap Enable or disable the bootstrap css. Useful if bootstrap has already been loaded on the page. diff --git a/docs/cms/10_Editor/10_Callbacks.md b/docs/cms/10_Editor/10_Callbacks.md new file mode 100644 index 0000000..82c37c5 --- /dev/null +++ b/docs/cms/10_Editor/10_Callbacks.md @@ -0,0 +1,73 @@ +There are several callbacks availible to hook into the editors processing. + +## Structure + +All callbacks use the same basic structure: + + + +## Parameters + +A callback must accept these two parameters: + +`object` - a copy of the data that is about to be saved, or was just saved. +`next` - a function that must be called after your code is finished to continue processing the request. + +You must with call `next(object);` to continue or `next(false);` to cancel the request. + +## Before Callbacks + +Before callbacks are fired before anything is sent to the server to be saved. Use these callbacks to valid user imput, or load remote data and merge it into the object before saving. You can cancel the save completly by calling `next(false);` + +| Name | On | Description | +| :--- | :--- | :--- | +| before_create | create | Called before creating a new object in a collection. | +| before_update | update | Called before updating an existing object in a collection. | +| before_save | create or update | Called before saving any object in a collection. | + +## After Callbacks + +Once the data has been saved to the server, use after callbacks to trigger any other actions you need to happen. An example might be sending a welcome email when someone creates a new object. You can no longer cancel the save, but you can stop further callbacks from executing by calling `next(false);` + +| Name | On | Description | +| :--- | :--- | :--- | +| after_create | create | Called after creating a new object in a collection. | +| after_update | update | Called after updating an existing object in a collection. | +| after_save | create or update | Called after saving any object in a collection. | + +## Multiple Callbacks + +You can use several callbacks together, just remember to call `next(object);` to continue the chain. + +## Firing Order + +Callbacks are fired in a specific order. Here is a breakdown of each possible chain. + +**Creating New Object:** + +1. before_create +1. before_save +1. [saves] +1. after_create +1. after_save + +**Saving Existing Object:** + +1. before_update +1. before_save +1. [saves] +1. after_update +1. after_save \ No newline at end of file diff --git a/docs/04_SDK/05_PHP/01_Getting_Started.md b/docs/cms/15_SDK/05_PHP/01_Getting_Started.md similarity index 100% rename from docs/04_SDK/05_PHP/01_Getting_Started.md rename to docs/cms/15_SDK/05_PHP/01_Getting_Started.md diff --git a/docs/04_SDK/05_PHP/05_Setup.md b/docs/cms/15_SDK/05_PHP/05_Setup.md similarity index 100% rename from docs/04_SDK/05_PHP/05_Setup.md rename to docs/cms/15_SDK/05_PHP/05_Setup.md diff --git a/docs/04_SDK/05_PHP/20_Debugging.md b/docs/cms/15_SDK/05_PHP/20_Debugging.md similarity index 100% rename from docs/04_SDK/05_PHP/20_Debugging.md rename to docs/cms/15_SDK/05_PHP/20_Debugging.md diff --git a/docs/04_SDK/05_PHP/25_Methods/00_Config.md b/docs/cms/15_SDK/05_PHP/25_Methods/00_Config.md similarity index 100% rename from docs/04_SDK/05_PHP/25_Methods/00_Config.md rename to docs/cms/15_SDK/05_PHP/25_Methods/00_Config.md diff --git a/docs/04_SDK/05_PHP/25_Methods/01_Single.md b/docs/cms/15_SDK/05_PHP/25_Methods/04_Single.md similarity index 100% rename from docs/04_SDK/05_PHP/25_Methods/01_Single.md rename to docs/cms/15_SDK/05_PHP/25_Methods/04_Single.md diff --git a/docs/04_SDK/05_PHP/25_Methods/05_Multiple.md b/docs/cms/15_SDK/05_PHP/25_Methods/05_Multiple.md similarity index 100% rename from docs/04_SDK/05_PHP/25_Methods/05_Multiple.md rename to docs/cms/15_SDK/05_PHP/25_Methods/05_Multiple.md diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/06_Count.md b/docs/cms/15_SDK/05_PHP/25_Methods/06_Count.md new file mode 100644 index 0000000..74a1f4b --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/06_Count.md @@ -0,0 +1,9 @@ +Count() will return the number of objects in a collection that match your query. + +To call the API, use the $cms variable and provide the count() method with a collection name: + + $count = $cms->count('listings'); + +This can be used in conjuction with filters: + + $count = $cms->filter(array('account' => '25'))->count('listings'); \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/07_Sort.md b/docs/cms/15_SDK/05_PHP/25_Methods/07_Sort.md new file mode 100644 index 0000000..e49956b --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/07_Sort.md @@ -0,0 +1,13 @@ +Sort allows a Multiple() query to return objects from a collection in a desired order. + +The sort() method accepts an array or JSON string of field types and order direction ("asc" or "desc"). + + $listings = $cms->sort(array('state' => 'asc', 'name' => 'asc'))->multiple('listings'); + + $listings = $cms->sort("{'state':'asc', 'name':'asc'}")->multiple('listings'); + +Sort() can also be used in conjuction with filters to finely control query output. + + $listings = $cms->sort(array('state' => 'asc', 'name' => 'asc'))->filter(array('account_id' => '25'))->multiple('listings'); + + $listings = $cms->sort("{'state':'asc', 'name':'asc'}")->filter("{'account_id':'25')}")->multiple('listings'); \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/08_Filter.md b/docs/cms/15_SDK/05_PHP/25_Methods/08_Filter.md new file mode 100644 index 0000000..d926eb3 --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/08_Filter.md @@ -0,0 +1,9 @@ +Filter can be used in conjuction with a Single() or Multiple() query to find specific records in a collection. Applying a filter will allow a query to return records in the collection with matching field values. + +An associative array or JSON string can be passed to the filter: + + $listing = $cms->filter(array('account_id' => '25'))->multiple('listings'); + +or + + $listing = $cms->filter("{'account_id':'25'}")->multiple('listings'); \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/09_Id.md b/docs/cms/15_SDK/05_PHP/25_Methods/09_Id.md new file mode 100644 index 0000000..ab9b76b --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/09_Id.md @@ -0,0 +1,5 @@ +object **id** ( int *$id* ) + +Slug() provides shorthand filtering in conjunction with Single(). It will match the collection object with the specified id parameter. + + $listing = $cms->id(4775)->single('listings'); \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/10_Slug.md b/docs/cms/15_SDK/05_PHP/25_Methods/10_Slug.md new file mode 100644 index 0000000..7f15414 --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/10_Slug.md @@ -0,0 +1,6 @@ +object **slug** ( string *$slug* ) + +Slug() provides shorthand filtering in conjunction with Single(). It will match the collection object with the specified slug parameter. + + $listing = $cms->slug('listing-5')->single('listings'); + diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/11_Param.md b/docs/cms/15_SDK/05_PHP/25_Methods/11_Param.md new file mode 100644 index 0000000..94abc25 --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/11_Param.md @@ -0,0 +1,5 @@ +object **param** ( string *$key*, string *$value* ) + +Param() privides a means of adding arbitrary parameters to a TodayCMS API call. + + $cms->param('overwrite', true); \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/15_Read.md b/docs/cms/15_SDK/05_PHP/25_Methods/15_Read.md new file mode 100644 index 0000000..c731dac --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/15_Read.md @@ -0,0 +1,17 @@ +Read() provides a means for Single() and Multiple() to interface with the TodayCMS API and query the API for objects from a specified collection. query the API for objects from a specified collection. + + $listings = $cms->read('listings'); + // returns all objects from the 'listings' collection + +It can be used in conjunction with Sort() and Filter() to provide fine control over query results. + + $listings1 = $cms->sort(array('name':'asc'))->multiple('listings'); + // returns all objects from the 'listings' collection, sorted in ascending order by 'name' + + $listings2 = $cms->filter(array('account_id':'25'))->multiple('listings'); + // returns all objects from the 'listings' collection with an 'account_id' matching '25' + +It can be used in conjuction with 'limit' and 'offset' parameters to determine the maximum number of results and paging. + + $listings = $cms->param('limit', 15)->param('offset', 2)->multiple('listings'); + // returns 15 objects from the second page of results, or objects 16-30 \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/16_Create.md b/docs/cms/15_SDK/05_PHP/25_Methods/16_Create.md new file mode 100644 index 0000000..b28b24b --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/16_Create.md @@ -0,0 +1,5 @@ +Create() provides a means of interfacing with the TodayCMS API to create a new object in a specified collection. + + $listing = $cms->create('listings', array('name' => 'Listing Name', 'account_id' => '25')); + +Returns an associative array of the new object or false. \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/17_Update.md b/docs/cms/15_SDK/05_PHP/25_Methods/17_Update.md new file mode 100644 index 0000000..1cb9a06 --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/17_Update.md @@ -0,0 +1,17 @@ +Update() provides a means of interfacing with the TodayCMS API to update an object or group of objects in a specified collection. + +Update() must be used in conjunction with Filter(). An empty filter object will allow Update() to modify all objects in the collection; otherwise, all objects matching the filter object parameters will be modified. + +To modify all objects in a collection: + + $listing = $cms->filter()->update('listings', array('name' => 'Listing Name', 'account_id' => '25')); + +To modify a subset of objects in a collection: + + $listing = $cms->filter(array('state' => 'ND'))->update('listings', array('name' => 'Listing Name', 'account_id' => '25')); + +By default, Update() will merge data with the existing data in the object. If you wish to overwrite all data in the object with the newly provided data, you must set the 'overwrite' parameter to 'true'. + + $listing = $cms->param('overwrite', true)->filter()->update('listings', array('name' => 'Listing Name', 'account_id' => '25')); + +Returns an associative array of the new object or false. \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/18_Delete.md b/docs/cms/15_SDK/05_PHP/25_Methods/18_Delete.md new file mode 100644 index 0000000..7a93969 --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/18_Delete.md @@ -0,0 +1,15 @@ +array **delete** ( string *$collection* ) + +Delete() provides a means of interfacing with the TodayCMS API to delete an object or group of objects in a specified collection. + +Delete() must be used in conjunction with Filter(). An empty filter object will allow Delete() to remove all objects in the collection; otherwise, all objects matching the filter object parameters will be removed from the datastore. + +To delete all objects in a collection: + + $listing = $cms->filter()->delete('listings'); + +To delete a subset of objects in a collection: + + $listing = $cms->filter(array('state' => 'ND'))->delete('listings'); + +Returns an associative array of the new object or false. \ No newline at end of file diff --git a/docs/cms/15_SDK/05_PHP/25_Methods/19_GetApiUrl.md b/docs/cms/15_SDK/05_PHP/25_Methods/19_GetApiUrl.md new file mode 100644 index 0000000..d05c895 --- /dev/null +++ b/docs/cms/15_SDK/05_PHP/25_Methods/19_GetApiUrl.md @@ -0,0 +1,9 @@ +string **get_api_url** ( string *$collection* ) + +Get_Api_Url() is a helper method for accessing the current construction of the TodayCMS API call url. It returns the full path to the API along with the api key and all parameters that have been attached with Param(), Sort(), Filter(), Slug(), and Id(). + + $listing = $cms->param('overwrite', true)->id(25)); + + $url = $cms->get_api_url('listings'); + // 'http://path.to.api/collections/listings/25?_tokens&overwrite=true' + diff --git a/docs/04_SDK/05_PHP/25_Methods/10_Formbuilder.md b/docs/cms/15_SDK/05_PHP/25_Methods/30_Formbuilder.md similarity index 100% rename from docs/04_SDK/05_PHP/25_Methods/10_Formbuilder.md rename to docs/cms/15_SDK/05_PHP/25_Methods/30_Formbuilder.md diff --git a/docs/cms/16_Front-End_Helpers/05_PHP/01_Map/01_Methods.md b/docs/cms/16_Front-End_Helpers/05_PHP/01_Map/01_Methods.md new file mode 100644 index 0000000..9789573 --- /dev/null +++ b/docs/cms/16_Front-End_Helpers/05_PHP/01_Map/01_Methods.md @@ -0,0 +1,38 @@ +object **latlng** ( int *$lat*, int *$lng* ) + +Sets the latitude and longitude of the Map object. + + $map->latlng(40.11, -100.20); + +object **height** ( string *$height* ) + +Sets the max-height of the Map object in 'px' or '%'. + + $map1->height('400px'); + $map2->height('100%'); + +object **width** ( string *$width* ) + +Sets the max-width of the Map object in 'px' or '%'. + + $map1->width('400px'); + $map2->width('100%'); + +object **infoWindow** ( string *$content* ) + +Sets the content of the infoWindow displayed in the embeddable Map object. + + $map->infoWindow('Hello World!'); + +object **infoWindowMaxWidth** ( string *$maxwidth* ) + +Sets the max-width of the Map object in 'px' or '%'. + + $map1->width('400px'); + $map2->width('100%'); + +string **render** ( *void* ) + + $map->render(); + +Renders Map object into an embeddable string that displays a Google Map on the webpage. \ No newline at end of file diff --git a/docs/cms/16_Front-End_Helpers/05_PHP/01_Map/02_Usage.md b/docs/cms/16_Front-End_Helpers/05_PHP/01_Map/02_Usage.md new file mode 100644 index 0000000..6290994 --- /dev/null +++ b/docs/cms/16_Front-End_Helpers/05_PHP/01_Map/02_Usage.md @@ -0,0 +1,10 @@ + +The Map object can be initialized with a latitude and longitude: + + $map1 = new Map(40.11, -100.20); + $map1->render(); + +Alternatively, you can add properties to the Map with various setter Methods. + + $map2 = new Map(); + $map2->latlng(40.11, -100.20)->width('640px')->height('480px')->infoWindow('Hello World!')->render(); \ No newline at end of file diff --git a/tmdocs/config.json b/docs/cms/config.json similarity index 85% rename from tmdocs/config.json rename to docs/cms/config.json index fe41d7e..e5fbcc0 100644 --- a/tmdocs/config.json +++ b/docs/cms/config.json @@ -1,8 +1,8 @@ { "title": "TodayCMS Documentation", "homepage": "/Getting_Started", - "theme": "bootstrap", - "hightlight": "none", + "theme": "simplex", + "hightlight": "dark", "twitter": ["todaymade"], "links": { "Todaymade": "http://todaymade.com", diff --git a/docs/config.json b/docs/config.json index 2651a1c..2a6c6c2 100644 --- a/docs/config.json +++ b/docs/config.json @@ -3,11 +3,12 @@ "tagline": "The Easiest Way To Document Your App", "image": "/img/app.png", "theme": "navy", - "repo": "justinwalsh/tm-docs", + "float": false, + "repo": "justinwalsh/daux.io", "twitter": ["justin_walsh", "todaymade"], "links": { - "Github Repo": "https://github.com/justinwalsh/tm-docs", - "Help/Support/Bugs": "https://github.com/justinwalsh/tm-docs/issues", + "Github Repo": "https://github.com/justinwalsh/daux.io", + "Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues", "Todaymade": "http://todaymade.com" } } \ No newline at end of file diff --git a/index.php b/index.php index 6fb714b..ad816a2 100644 --- a/index.php +++ b/index.php @@ -26,14 +26,14 @@ Feedback & Suggestions To give us feedback or to suggest an idea, please create an request on the the Github issue tracker: -https://github.com/justinwalsh/tm-docs/issues +https://github.com/justinwalsh/daux.io/issues Bugs ---- To file bug reports please create an issue using the github issue tracker: -https://github.com/justinwalsh/tm-docs/issues +https://github.com/justinwalsh/daux.io/issues Copyright and License @@ -63,12 +63,18 @@ software, even if advised of the possibility of such damage. */ - ini_set('display_errors', 1); - error_reporting(E_ALL); - require_once('libs/functions.php'); +require_once('libs/functions.php'); + +$options = get_options(); +$tree = get_tree("docs"); +$homepage_url = homepage_url($tree); +$docs_url = docs_url($tree); + +// Redirect to docs, if there is no homepage +if ($homepage && $homepage_url !== '/') { + header('Location: '.$homepage_url); +} - $options = get_options(); - $tree = get_tree("docs"); ?> @@ -78,8 +84,8 @@ software, even if advised of the possibility of such damage. <?=$options['title']; ?> - - + + @@ -123,7 +129,7 @@ software, even if advised of the possibility of such damage.