Kotlin / dokka

API documentation engine for Kotlin
https://kotl.in/dokka
Apache License 2.0
3.4k stars 399 forks source link

style.css is generated outside of the module directory #163

Closed encodeering closed 1 year ago

encodeering commented 7 years ago

Hello,

would it be possible to provide a configuration for the style.css location?

Configuration

    moduleName = "hello-world"
    outputDirectory = "build/javadoc"
    outputFormat = "html"

Generated directory structure by dokka 0.9.13

build/
   javadoc/
     hello-world/
       index.html
       ...
     style.css

Would like to push the javadoc/hello-world directory to github pages.

Thank you very much.

gobarcanin commented 6 years ago

I am facing the same problem, because I want to use dokka documentation in pages. This would help a lot and I presume that this is not too much work 😄

asiljan commented 6 years ago

+1

Schuwi commented 6 years ago

I'm having the same problem. The directory structure is very odd for single-module projects.

DanySK commented 5 years ago

Same issue here.

almayce commented 5 years ago

Same issue.. My solution for gitlab pages (replace your_module):

image: java:8-jdk

stages:
  - dokka
  - deploy

javadoc:
  stage: dokka
  script:
    - ./gradlew dokka -i
  artifacts:
    paths:
      - public

pages:
  stage: deploy
  script:
    - cp -R public/your_module/. public/
    - for line in $(find ./public -name '*.html'); do sed -i 's/..\/style.css/style.css/g' ${line##* .}; done
  artifacts:
    paths:
      - public
  only:
    - master
widarlein commented 4 years ago

Yeah, +1 on this issue!

ethauvin commented 4 years ago

Or at the very least implement #394

jimfilippou commented 4 years ago
  • for line in $(find ./public -name '.html'); do sed -i 's/..\/style.css/style.css/g' ${line## .}; done

I get this can be a workaround, but it doesn't work 😢

gnarea commented 4 years ago

Workaround for anyone using GitHub Actions + GitHub Pages:

      - name: Move Dokka's stylesheet
        run: |
          set -x -o nounset -o errexit -o pipefail
          cd ./build/javadoc
          mv ./style.css ./THE-NAME-OF-YOUR-MODULE/
          find . -name '*.html' -print0 | xargs -0 sed -i 's;../style.css;style.css;g'
kibotu commented 3 years ago

I've added it as snippet for fixing it manually in case you want to run it on jenkins or the likes https://gist.github.com/kibotu/78f6f65497eef81222ca3fb9b785e38d

gnarea commented 3 years ago

I've just upgraded to v1 and I'm having to use a more complex workaround because it isn't just the style.css that's outside the module directory, but lots of assets now. Here's what I'm doing with GitHub Actions + GitHub pages:

      - name: Move Dokka's assets
        run: |
          set -x -o nounset -o errexit -o pipefail
          cd ./build/dokka/html
          mv ./styles ./images ./scripts navigation.html ./THE-NAME-OF-YOUR-MODULE/
          find ./poweb/ -name '*.html' -print0 | xargs -0 sed -i 's;../styles/;styles/;g'
          find ./poweb/ -name '*.html' -print0 | xargs -0 sed -i 's;../images/;images/;g'
          find ./poweb/ -name '*.html' -print0 | xargs -0 sed -i 's;../scripts/;scripts/;g'
          find ./poweb/ -name '*.html' -print0 | xargs -0 sed -i 's;pathToRoot = "../;pathToRoot = ";g'
          sed -i 's;href="poweb/;href=";g' ./poweb/navigation.html
atyrin commented 2 years ago

Hi everyone! I see that the issue has a lot of upvotes, but is it still actual? If we are talking about the dokkaHtml task in non a multimodule scenario, then the structure in the latest release version looks like

build/
   dokka/
     hello-world/
     styles/
       …
       style.css
     images/
     scripts/
     index.html

Seems like a valid structure.

But I see that @gnarea still experiences a problem and moves assets in the module folder. What is the reason behind it? Isn't it possible to push the whole dokka folder? Or is it some GitHub Pages limitation?

FWDekker commented 1 year ago

@atyrin I don't think the issue is still actual. I upvoted the issue when it was originally opened, but in my projects the latest version of Dokka no longer places the styles outside of the module directory.

atyrin commented 1 year ago

I'm closing the issue since the problem is not actual anymore in the form as described in the top message. If you still experience similar troubles with the latest Dokka releases, please submit a new issue.