@sudhirkhanger there is nothing built-in for Orchid, currently, but the OrchidPosts plugin handles content very similarly to Jekyll or other SSGs, so the migration tools for other SSGs should get you mostly what you need to import it into Orchid as well. Might need to do some manual work to make sure the Front Matter fields are correct after using those tools, but they should be helpful for the bulk of the work.
Here's the migration tool for Jekyll: https://import.jekyllrb.com/docs/wordpress/
And Hugo has a few options as well, if the Jekyll one doesn't work: https://gohugo.io/tools/migrations/#wordpress
@/all The long-awaited release of 0.18.0 is finally here! There are lots of changes, most of them backward-compatible, but make sure to read the release notes and migration guide to know the full extent of changes and new features.
And as always, if you have any questions or problems with the new version, don't hesitate to reach out here!
kotlindoc.fromCacheto false to make sure it's not trying to read from a stale cache, and also try setting
kotlindoc.showRunnerLogsto true to see the full Dokka output; maybe there's an error happening internally that is being hidden
kotlindoc/. So a page previously at
localhost:8080/com/example/Applicationwould now be at
localhost:8080/kotlindoc/com/example/Applicationby default (though the permalink is customizable)
> Task :docs:orchidServe Using the following modules: -------------------- * com.eden.orchid.StandardModule WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/Users/sudhanshusiddh/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/4.2.2/6dacbe18e5eaa7f6c9c36db33b42e7985e94ce77/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
[WARN] Warnings: [WARN] ModularList: [WARN] - OrchidMenuFactory type [sourcedocPages] could not be found in OrchidMenu (on page 'Home' at http://localhost:8080)
This is the config file I have been using:
site: about: siteName: Company Name siteDescription: Android SDK kotlindoc: sourceDirs: - './../../../../app/src/main/java/com/company/api/Class1.kt' - './../../../../app/src/main/java/com/company/api/domain/feature/model/Class2.kt' - './../../../../app/src/main/java/com/company/api/domain/feature/model/Class3.kt' - './../../../../app/src/main/java/com/company/api/interfaces/Interface1.kt' pages: menu: - type: 'sourcedocPageLinks' moduleType: 'kotlindoc' includeItems: true theme: primaryColor: '#6cc04a' legacySearch: false metaComponents: - type: 'orchidSearch' menu: - type: 'separator' title: 'Wiki' - type: 'wiki' - type: 'page' itemId: 'Changelog' - type: 'separator' title: 'API Docs' - type: 'sourcedocPages' moduleType: 'kotlindoc' node: 'classes' asSubmenu: true submenuTitle: 'Classes' - type: 'sourcedocPages' moduleType: 'kotlindoc' node: 'packages' asSubmenu: true submenuTitle: 'Packages'
This is including the changes mention in the migration guide. The sourceDir section hasn't been touched. I need to document only specific files for the project.
"orchidRuntime"("io.github.javaeden.orchid:OrchidKotlindoc:0.18.0")as mentioned here https://orchid.run/plugins/orchidsourcedoc
OrchidSourceDocto keep everything the same, but
OrchidKotlindocetc. is still needed. It's now just a lightweight wrapper to add specific language support to the new system
OrchidBibleis the only one still needing anything from Jitpack, so you can try just specifying the plugins you want instead of using
kotlindocClassesthe link doesn't work. What would be the right way to achieve that kind of behavior?
menu: - type: 'page' title: 'Home' itemId: 'Home' - type: 'wikiSections' - type: 'page' itemId: 'Changelog' - type: 'kotlindocPackages' - type: 'kotlindocClasses'
I did try adding these to config.yml but these configs don't work on Copper.
kotlindoc: sourceDirs: - './../../../../app/src/main/java/' pages: extraCss: - 'assets/css/orchidKotlindoc.scss' menu: - type: "kotlindocClassLinks" includeItems: true theme: social: other: - link: 'repo link' label: 'Github' icon: 'fab fa-github menu: - type: 'page' title: 'Home' itemId: 'Home' - type: 'wikiSections' - type: 'page' itemId: 'Changelog' - type: 'kotlindocPackages' - type: 'kotlindocClasses' sidebarBackground: 'primary' sidebarBackgroundType: GRADIENT colors: green: '#6cc04a' grey: '#555759' palette: primary: 'GREEN' link: 'GREY' wiki: wikiPages: layout: wiki menu: - type: wiki
PS: Using 0.17 version.
kotlindocPackages' and 'kotlindocClasses' under thekotlindoc.pages` archetype key, for example
index_menubut missed that change in the 0.17.x release notes. Try using
index_menuas the layout and it should work.
@sudhirkhanger You can customize the CSS for any theme, adding CSS to change or hide elements as-needed. See here for docs on adding additional CSS to your theme.
Alternatively, you could override the layout template and remove/change anything you need to in that. It sounds like you're using the FutureImperfect theme, so you would copy this file to
templates/layouts/layoutBase.peb in your site's resources and make any changes you want to that file.
@cjbrooks12 Thanks Casey. It would be nice if there was a tutorial on how to create your own themes. I understand that you can include the themes as a gradle dependency but that doesn't help if you want to create something from scratch. I realized that I had to create a multi-module gradle project for my use case so I took the contents of BsDoc directory from orchid's source code and included it as a module to my project so I can tweak it a bit. I think this process should be documented. Now when I try to run the project using
./gradlew orchidServe I get the following error:
Error: Could not find or load main class com.eden.orchid.Orchid
Caused by: java.lang.ClassNotFoundException: com.eden.orchid.Orchid
I'd appreciate if you had a look at my repo and tell me what's wrong with my gradle config as I'm not familiar with gradle-kotlin scripts yet.
@ThanosFisherman Yeah, I really need to get some docs written for custom theming. Overall, using a custom theme isn't much different from customizing existing themes, so the docs on templates is most of what you need for building layouts, and JavaEden/Common repo docs for adding configuration options to your Theme class.
That said, your project is actually set up (mostly) correctly. You should only apply the
com.eden.orchidPlugin Gradle plugin to the subprojects that have an Orchid site and its needed dependencies. You have the plugin set up and applies in the root
build.gradle, so it's trying to run Orchid from the root project instead of the site subproject. Just need to change
id("com.eden.orchidPlugin") version Versions.ORCHID to
id("com.eden.orchidPlugin") version Versions.ORCHID apply false in the root
build.gradle.kts for it to all work.
In addition, you don't need to use a separate theme module, unless you want to share the theme among several sites. Strikt.io is an example of a site built using a custom theme, and it's pretty simple so it's another good guide for making your own theme (see sources here). The way your project is set up, with a separate theme module, is perfectly correct, but you can also save some boilerplate by putting the theme in the same module as the site as in the Strikt site. Templates will also be live-reloaded in the local project, unlike in a separate project (since the theme jar needs to be rebuilt to template changes to be recognized).
What problems are you still having with it? I am able to get a sidebar menu populated with the kotlin class/package links just fine.
For version Copper theme v0.17.6, the sidebar menu is displayed when a page uses the
index_menu layout, and the menu items in that sidebar are from the page menu. Something like the following will set the layout of all pages to
index_menu and add the menu items to that menu to be displayed:
# config.yml allPages: layout: 'index_menu' menu: - type: 'kotlindocPackages' - type: 'kotlindocClasses'