Coder Social home page Coder Social logo

Comments (6)

ZedThree avatar ZedThree commented on June 16, 2024

This is because anything declared in a submodule is private, and so won't be documented by default. You can put display: private in the ford comment on mod_s to include impl_class_t:

submodule (mod) mod_s
  !! display: private

  ...

image

Note that this will also include docs for the implementations of create and impl_foo. I don't think there's a way to annotate a single entity to be included in the rendered docs.

from ford.

mscfd avatar mscfd commented on June 16, 2024

Thanks a lot for pointing out. As I need this for all submodules and also want to have all private entities documented, I can actually use the "display: private" option in the ford project setup file. I came across that option but did not make the connection to submodules. Maybe it would be helpful to mention submodules there?

from ford.

mscfd avatar mscfd commented on June 16, 2024

As I wrote display: private helps exposing the submodule types, but ford fails at referencing public derived types. For the test project below with a module and accompanying submodule the "derived-type table" lists type "impl" but not "base". Moreover, it says that "impl" extends "../../base", and links are missing.

Remarks:
(1) Note that ford_project_file.md is placed in "./build" and the two source files are placed in "./src".

(2) If I remove "display:private" then impl disappears and base becomes visible.

(3) If I remove "display:private" then base becomes visible, but the abstract attribute is missing from the derived-type description.

ford_project_file.md:

---
project: test
summary: test
src_dir: ../src
output_dir: ./doc
summary: test
author: test
author_description: test
display: private
proc_internals: true
show_proc_parent: true
preprocess: true
predocmark: >
source: true
graph: true
graph_maxdepth: 10
graph_maxnodes: 50
coloured_edges: false
search: true
max_frontpage_items: 4
parallel: 0
---

test.f90

module test

implicit none
private

public create

!> my base class
type, abstract, public :: base
   !> base component
   integer :: i = 5
end type base

interface
   module function create() result(p)
      class(base), pointer :: p
   end function create
end interface

end module test

test_smod.f90

submodule (test) test_smod

implicit none

!> my implementation of base
type, extends(base) :: impl
   !> implementation component
   integer :: k = 6
end type impl

contains

module function create() result(p)
   class(base), pointer :: p
   allocate(impl :: p)
end function create

end submodule test_smod

from ford.

mscfd avatar mscfd commented on June 16, 2024

Ok re-reading the documentation I surmised that I need to provide public and private and possibly protected as well. I finally succeeded by adding the three lines

display: private
display: public
display: protected

to the project file. Is there any use-case where one wants to see private but not public instances? This is bound to cause confusion.

BTW: for the "abstract" property I will open a new issue.

from ford.

ZedThree avatar ZedThree commented on June 16, 2024

Is there any use-case where one wants to see private but not public instances? This is bound to cause confusion.

Yes, I don't think you're the first to be confused by this. I should write up a FAQ with common questions like this

from ford.

mscfd avatar mscfd commented on June 16, 2024

But, is there any use-case? Or should it not be changed to "private implies public"?

from ford.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.