-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc publication to gh-pages (#11)
- Loading branch information
1 parent
bcd2c25
commit 7f89283
Showing
34 changed files
with
8,952 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Move to docs | ||
run: cd docs | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21 | ||
- name: Install dependencies | ||
run: cd docs && yarn install --frozen-lockfile | ||
- name: Build website | ||
run: cd docs && yarn build | ||
# Popular action to deploy to GitHub Pages: | ||
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# Build output to publish to the `gh-pages` branch: | ||
publish_dir: ./docs/build | ||
cname: stylesniffer.cookiecode.dev | ||
# The following lines assign commit authorship to the official | ||
# GH-Actions bot for deploys to `gh-pages` branch: | ||
# https://github.com/actions/checkout/issues/13#issuecomment-724415212 | ||
# The GH actions bot is used by default if you didn't specify the two fields. | ||
# You can swap them out with your own user credentials. | ||
user_name: github-actions[bot] | ||
user_email: 41898282+github-actions[bot]@users.noreply.github.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* The MIT License | ||
* Copyright © 2024 Sebastien Vermeille | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Contributing | ||
|
||
Everyone is welcome to contribute to this Open Source project. | ||
|
||
Contributions are very welcome! Please raise issues on GitHub and even better submit some PRs :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# Getting Started | ||
|
||
## Add the dependency | ||
|
||
<Tabs | ||
values={[ | ||
{ label: 'Maven', value: 'maven' }, | ||
{ label: 'Gradle (Kotlin)', value: 'gradle' }, | ||
]} | ||
> | ||
<TabItem value="maven"> | ||
**pom.xml** | ||
```xml | ||
<dependency> | ||
<groupId>dev.cookiecode</groupId> | ||
<artifactId>stylesniffer</artifactId> | ||
<version>1.0.0</version> | ||
</dependency> | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="gradle"> | ||
|
||
**gradle.properties** | ||
```kotlin | ||
implementation("dev.cookiecode:stylesniffer-impl:1.0.0") | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
> Note: Use the latest version: [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.cookiecode/stylesniffer-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.cookiecode/stylesniffer-parent) | ||
## Use StyleSniffer in your code | ||
|
||
<Tabs | ||
values={[ | ||
{ label: 'Java', value: 'java' }, | ||
{ label: 'Kotlin', value: 'kotlin' }, | ||
]} | ||
> | ||
<TabItem value="java"> | ||
```java | ||
var styleSniffer = StyleSnifferFactory.createStyleSniffer(); | ||
|
||
Optional<CaseStyle> caseStyle = styleSniffer.getCaseStyle("myVariableName"); | ||
caseStyle.ifPresent(style -> System.out.println("Matched style: " + style.getName())); | ||
|
||
Set<String> supportedStyles = styleSniffer.getSupportedCaseStyles(); | ||
System.out.println("Supported styles: " + supportedStyles); | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="kotlin"> | ||
|
||
**gradle.properties** | ||
```kotlin | ||
// TODO: document this code for Kotlin | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
slug: / | ||
sidebar_position: 1 | ||
--- | ||
# Overview | ||
|
||
## StyleSniffer: The Ultimate Case Style Detective | ||
|
||
![StyleSniffer Logo](/assets/stylesniffer-logo.png) | ||
|
||
|
||
**StyleSniffer** is a Java library crafted to simplify the detection and analysis of case styles | ||
in strings. | ||
|
||
Whether you're dealing with camelCase, snake_case, PascalCase, or any other naming convention, | ||
StyleSniffer provides a straightforward and efficient way to understand and manage these styles. | ||
|
||
### **Features:** | ||
|
||
- **Detect Case Styles:** Automatically identify common case styles such as camelCase, | ||
snake_case, PascalCase, and more. | ||
- **Flexible Integration:** Easily integrate StyleSniffer into your Java applications | ||
- **Simple API:** Enjoy a user-friendly API designed for seamless detection. | ||
|
||
### **Why StyleSniffer?** | ||
|
||
StyleSniffer excels at uncovering the subtle nuances of string case styles. | ||
|
||
- **Playful Precision:** Experience the blend of technical accuracy with a hint of fun. | ||
- **Easy to Use:** Whether you're a seasoned developer or just starting out, | ||
StyleSniffer's intuitive interface makes case style detection straightforward. | ||
- **Reliable:** Depend on StyleSniffer for consistent and accurate results. | ||
|
||
### **Which CaseStyle are supported?** | ||
|
||
* [PascalCase](https://wiki.c2.com/?PascalCase) also known as ([UpperCamelCase](https://wiki.c2.com/?UpperCamelCase) or [CamelCase](https://en.wikipedia.org/wiki/Camel_case)) | ||
* [camelCase](https://en.wikipedia.org/wiki/Camel_case) also known as ([LowerCamelCase](https://en.wikipedia.org/wiki/Camel_case)) | ||
* [kebab-case](https://wiki.c2.com/?KebabCase) also known as ([lisp-case](https://www.npmjs.com/package/kebab-case)) | ||
* [snake_case](https://en.wikipedia.org/wiki/Snake_case) | ||
* [SCREAMING_SNAKE_CASE](https://en.wiktionary.org/wiki/screaming_snake_case) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/// | ||
/// The MIT License | ||
/// Copyright © 2024 Sebastien Vermeille | ||
/// | ||
/// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
/// of this software and associated documentation files (the "Software"), to deal | ||
/// in the Software without restriction, including without limitation the rights | ||
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
/// copies of the Software, and to permit persons to whom the Software is | ||
/// furnished to do so, subject to the following conditions: | ||
/// | ||
/// The above copyright notice and this permission notice shall be included in | ||
/// all copies or substantial portions of the Software. | ||
/// | ||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
/// THE SOFTWARE. | ||
/// | ||
|
||
import {themes as prismThemes} from 'prism-react-renderer'; | ||
import type {Config} from '@docusaurus/types'; | ||
import type * as Preset from '@docusaurus/preset-classic'; | ||
|
||
const config: Config = { | ||
title: 'StyleSniffer', | ||
tagline: 'Detect which case style is used in a name', | ||
favicon: 'img/favicon.ico', | ||
|
||
url: 'https://stylesniffer.cookiecode.dev', | ||
// Set the /<baseUrl>/ pathname under which your site is served | ||
// For GitHub pages deployment, it is often '/<projectName>/' | ||
baseUrl: '/', | ||
trailingSlash: false, | ||
|
||
plugins: [require.resolve("docusaurus-plugin-image-zoom")], | ||
|
||
// GitHub pages deployment config. | ||
organizationName: 'sebastienvermeille', | ||
projectName: 'StyleSniffer', | ||
deploymentBranch: 'gh-pages', | ||
|
||
onBrokenLinks: 'throw', | ||
onBrokenMarkdownLinks: 'warn', | ||
|
||
// Even if you don't use internationalization, you can use this field to set | ||
// useful metadata like html lang. For example, if your site is Chinese, you | ||
// may want to replace "en" with "zh-Hans". | ||
i18n: { | ||
defaultLocale: 'en', | ||
locales: ['en'], | ||
}, | ||
|
||
presets: [ | ||
[ | ||
'classic', | ||
{ | ||
docs: { | ||
routeBasePath: '/', | ||
sidebarPath: './sidebars.ts', | ||
editUrl: | ||
'https://github.com/sebastienvermeille/StyleSniffer/tree/master/docs/docs', | ||
}, | ||
blog: false, | ||
theme: { | ||
customCss: './src/css/custom.css', | ||
}, | ||
} satisfies Preset.Options, | ||
], | ||
], | ||
|
||
themeConfig: { | ||
navbar: { | ||
title: 'StyleSniffer', | ||
logo: { | ||
alt: 'StyleSniffer Logo', | ||
src: 'assets/stylesniffer-logo-square-small.png', | ||
}, | ||
items: [ | ||
{ | ||
href: 'https://github.com/sebastienvermeille/StyleSniffer', | ||
label: 'GitHub', | ||
position: 'right', | ||
}, | ||
], | ||
}, | ||
prism: { | ||
theme: prismThemes.github, | ||
darkTheme: prismThemes.dracula, | ||
}, | ||
algolia: { | ||
appId: 'E1W6T35JS9', | ||
apiKey: '98471285c8a136a9d660a78e4e523445', | ||
indexName: 'StyleSniffer', | ||
|
||
// Optional: see doc section below | ||
contextualSearch: true, | ||
|
||
// Optional: Algolia search parameters | ||
searchParameters: {}, | ||
|
||
// Optional: path for search page that enabled by default (`false` to disable it) | ||
searchPagePath: 'search', | ||
|
||
}, | ||
} satisfies Preset.ThemeConfig, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.