oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.34k stars 745 forks source link

Markdown does not show when running docker:latest #2776

Closed JozoVilcek closed 5 years ago

JozoVilcek commented 5 years ago

I was testing opengrok locally and used official docker run from https://github.com/OpenGrok/docker#how-to-run

So I did docker run -d -v <path/to/your/src>:/opengrok/src -p 8080:8080 opengrok/docker:latest waited for initial reindex to finish and then look at repo listing with README.md. The result was image without markdown rendered. Does it need to be enabled somehow?

vladak commented 5 years ago

I assume this is with OpenGrok 1.2.8 ("latest" will not mean much when someone revisits this issue in the future)

The README detection is done unconditionally in src/main/java/org/opengrok/web/DirectoryListing.java#extraListTo() (called from list.jsp):


214          if (entries != null) {
215              for (DirectoryEntry entry : entries) {
216                  File child = entry.getFile();
217                  if (ignoredNames.ignore(child)) {
218                      continue;
219                  }
220                  String filename = child.getName();
221                  String filenameLower = filename.toLowerCase(Locale.ROOT);
222                  if (filenameLower.startsWith("readme") ||
223                          filenameLower.endsWith("readme")) {
224                      readMes.add(filename);
225                  }

So unless the README files are explicitly ignored they should be displayed.

JozoVilcek commented 5 years ago

Hm, I do not understand it, but after few refreshes or wait time, opengrok now shows readme rendered. I apologise for confusion

vladak commented 5 years ago

Well, this could be a bug related to timing/caching.