From d2bd7a5edb2643f071f0411a4ad815040cc3beea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Kn=C3=B6chel?= Date: Sun, 31 Oct 2021 16:20:52 +0100 Subject: [PATCH] fix: migrate readme --- README | 107 ----------------------------------------- README.md | 141 ++++++------------------------------------------------ 2 files changed, 15 insertions(+), 233 deletions(-) delete mode 100644 README diff --git a/README b/README deleted file mode 100644 index 5f3df2f..0000000 --- a/README +++ /dev/null @@ -1,107 +0,0 @@ -# Appcelerator Titanium Mobile Module Project - -This is a skeleton Titanium Mobile Mobile module project. - -## Module Naming - -Choose a unique module id for your module. This ID usually follows a namespace -convention using DNS notation. For example, com.appcelerator.module.test. This -ID can only be used once by all public modules in Titanium. - -## Getting Started - -1. Edit the `manifest` with the appropriate details about your module. -2. Edit the `LICENSE` to add your license details. -3. Place any assets (such as PNG files) that are required anywhere in the module folder. -4. Edit the `timodule.xml` and configure desired settings. -5. Code and build. - -## Documentation ------------------------------ - -You should provide at least minimal documentation for your module in `documentation` folder using the Markdown syntax. - -For more information on the Markdown syntax, refer to this documentation at: - - - -## Example - -The `example` directory contains a skeleton application test harness that can be -used for testing and providing an example of usage to the users of your module. - -## Building - -Simply run `appc run -p [ios|android] --build-only` which will compile and package your module. - -## Linting - -You can use `clang` to lint your code. A default Axway linting style is included inside the module main folder. -Run `clang-format -style=file -i SRC_FILE` in the module root to lint the `SRC_FILE`. You can also patterns, -like `clang-format -style=file -i Classes/*` - -## Install - -To use your module locally inside an app you can copy the zip file into the app root folder and compile your app. -The file will automatically be extracted and copied into the correct `modules/` folder. - -If you want to use your module globally in all your apps you have to do the following: - -### macOS - -Copy the distribution zip file into the `~/Library/Application Support/Titanium` folder - -### Linux - -Copy the distribution zip file into the `~/.titanium` folder - -### Windows -Copy the distribution zip file into the `C:\ProgramData\Titanium` folder - -## Project Usage - -Register your module with your application by editing `tiapp.xml` and adding your module. -Example: - - - ti.pdftools - - -When you run your project, the compiler will combine your module along with its dependencies -and assets into the application. - -## Example Usage - -To use your module in code, you will need to require it. - -### ES6+ (recommended) - -```js -import MyModule from 'ti.pdftools'; -MyModule.foo(); -``` - -### ES5 - -```js -var MyModule = require('ti.pdftools'); -MyModule.foo(); -``` - -## Testing - -To test your module with the example, use: - -```js -appc run -p [ios|android] -``` - -This will execute the app.js in the example/ folder as a Titanium application. - -## Distribution - -You have a variety of choises for distributing your module -- [Gitt.io](http://gitt.io/) -- [Axway Marketplace](https://marketplace.axway.com/home) - -Code strong! diff --git a/README.md b/README.md index 7d68997..ef1f3ed 100644 --- a/README.md +++ b/README.md @@ -1,138 +1,27 @@ -# Axway Titanium iOS Project +# Titanium iOS PDF Merge -This is a skeleton Titanium iOS module project. Modules can be used to extend -the functionality of Titanium by providing additional native code that is compiled -into your application at build time and can expose certain APIs into JavaScript. +Merges a given number of PDF files into one file using the `PDFKit` framework -## Naming +## Requirements -Choose a unique module id for your module. We usually stick to a naming convention -like `ti.map` or `titanium-map` to make it more easy to find Titanium modules in the wild. +- [x] iOS 11+ +- [x] Titanium SDK 9+ +## API's -## Components +### Methods -Components that are exposed by your module must follow a special naming convention. -A component (widget, proxy, etc) must be named with the pattern: +- `mergedPDF(paths) -> Ti.Blob`: Returns a `Ti.Blob` that represents a merged PDF from the given PDF files +- `pdfFromImage({ image: yourImage, resizeImage: true|false, padding: 80 })`: Returns a `Ti.Blob` that represents a PDF created from an image -``` -TiProxy -``` +## Example -For example, if you component was called Foo, your proxy would be named: +See `example/app.js` -``` -TiMyfirstFooProxy -``` +## Author -For view proxies or widgets, you must create both a view proxy and a view implementation. -If you widget was named proxy, you would create the following files: +Hans Knöchel -``` -TiMyfirstFooProxy.swift -TiMyfirstFoo.swift -``` +## License -The view implementation is named the same except it does contain the suffix `Proxy`. - -View implementations extend the Titanium base class `TiUIView`. View Proxies extend the -Titanium base class `TiUIViewProxy` or `TiUIWidgetProxy`. - -For proxies that are simply native objects that can be returned to JavaScript, you can -simply extend `TiProxy` and no view implementation is required. - -## Get started - -1. Edit manifest with the appropriate details about your module. -2. Edit LICENSE to add your license details. -3. Place any assets (such as PNG files) that are required in the assets folder. -4. Edit the titanium.xcconfig and make sure you're building for the right Titanium version. -5. Code and build. - -## Build time configuration - -You can edit the file `module.xcconfig` to include any build time settings that should be -set during application compilation that your module requires. This file will automatically get imported -in the main application project. - -For more information about this file, please see the [Apple documentation](https://developer.apple.com/library/content/featuredarticles/XcodeConcepts/Concept-Build_Settings.html). - -# Documentation - -You should provide at least minimal documentation for your module in `documentation` folder using the -Markdown syntax. - -For more information on the Markdown syntax, refer to [this documentation](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). - -## Examples - -The `example` directory contains a skeleton application test harness that can be -used for testing and providing an example of usage to the users of your module. - -## Install - -1. Run `appc run -p ios --build-only` which creates your distribution package -2. Switch to `~/Library/Application Support/Titanium` -3. Copy this zip file into the folder of your Titanium SDK or copy it to your local project - -## Register the module - -Register your module with your application by editing `tiapp.xml` and adding your module. -Example: - -``` - - __MODULE_ID__ - -``` - -When you run your project, the compiler will know automatically compile in your module -dependencies and copy appropriate image assets into the application. - -## Using the module - -To use your module in code, you will need to require it. - -For example, - -```js -var myModule = require('__MODULE_ID__'); -myModule.foo(); -``` - -## Pure JavaScript modules - -You can write a pure JavaScript "natively compiled" module. This is nice if you -want to distribute a JavaScript module pre-compiled. - -To create a module, create a file named __MODULE_ID__.js under the assets folder. -This file must be in the CommonJS format. For example: - -```js -exports.echo = (content) => { - return content; -}; -``` - -Any functions and properties that are exported will be made available as part of your -module. All other code inside your JavaScript will be private to your module. - -For pure JavaScript module, you don't need to modify any of the Swift module code. You -can leave it as-is and build. - -## Testing - -Run the `appc` CLI to test your module or test from within Xcode. -To test with the script, execute: - -``` -appc run --project-dir -``` - -This will execute the app.js in the example folder as a Titanium application. - -## Distribution - -You can either open source your module or distribute your module via the [Appcelerator Marketplace](https://marketplace.appcelerator.com). - -Cheers! +MIT