Skip to content

Improve API documentation - #123

Open
n0y0nD wants to merge 20 commits into
OpenPrinting:masterfrom
n0y0nD:improve-docs
Open

Improve API documentation #123
n0y0nD wants to merge 20 commits into
OpenPrinting:masterfrom
n0y0nD:improve-docs

Conversation

@n0y0nD

@n0y0nD n0y0nD commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

This PR improves and cleans up the public API documentation.

I reorganized and structured the documentation comments above
the relevant function prototypes, clarified parameter and return
descriptions, and made the formatting more consistent with the
documentation style used in CUPS.

This is part of the ongoing work for issue #54 .

Comment thread cupsfilters/filter.h
//
// System V interface script:
// https://www.ibm.com/docs/en/aix/7.2?topic=configuration-printer-interface-scripts

@tillkamppeter tillkamppeter Feb 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information is still relevant, please do not remove it.

You can move it to the comment block at the top of the function though.

Comment thread cupsfilters/filter.h
// rastertopwg. With Ghostscript supporting Apple Raster output
// (9.56.0 and newer), we actually produce Apple Raster and no further
// filter is required.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this "Note: ..." section. You can move it to the comment block at the top of the function.

Comment thread cupsfilters/filter.h
// actually produce if different from job's final output
// format, otherwise NULL to produce the job's final output
// format
// texttopdf_params: parameters for texttopdf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this information is still relevant, please do not remove it.

You can move it to the comment block at the top of the function though.

Comment thread cupsfilters/raster.h


//
// Prototypes...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not remove "// Prototypes...".

Add an empty comment line before the comment you are adding here.

@n0y0nD n0y0nD changed the title Improve API documentation in raster.h and filter.h Improve API documentation Jul 10, 2026
@tillkamppeter

Copy link
Copy Markdown
Member

Priscill (@prisorue), this PR is ny volunteer contributor Nayanjyoti Das (@n0y0nD). Here you can see our libcupsfilters API documentation worked on and you can team up with Nayanjyoti, for example also reviewing his work, see how to proceed for API documentation and apply it to our other libraries, ...

Comment thread cupsfilters/bannertopdf.c Outdated
Comment thread cupsfilters/bitmap.c Outdated
Comment thread cupsfilters/catalog.c Outdated
@tillkamppeter

Copy link
Copy Markdown
Member

Thanks for the inline documentation work.

Could you please not remove the longer, detailed comments which I have wrote up for some of the API functions. If they do not fit in for the automatic documentation generation, please put them into the manual part of the API documentation.

Please also tell when you are so far ready for the PR being merged.

Also the failing tests are not caused by your works. Other contributors are already working on them.

@prisorue

prisorue commented Aug 4, 2026

Copy link
Copy Markdown

@n0y0nD I sent you a DM via GChat with some questions.

@tillkamppeter I checked this PR. So far, what we need for API Docs are basically:

  • Input parameters
  • Output parameters
  • Function description

We need to balance developer-friendly inline header references with high-level architectural guides. Considering that we already have annotations in the *.h files, we can use a lightweight pipeline that combines Doxygen (source extraction) with GitHub Pages & Actions to host and deploy the content. Hence, before moving forward, a couple of questions:
a. Have you considered using Doxygen or any other similar tool to extract information from the headers?
b. If a == yes, what's the current status and where can I find more information about the approach used to document APIs?

@tillkamppeter

Copy link
Copy Markdown
Member

When I had developed libcupsfilters 2.x, libppd2.x, and pappl-retrofit, I have given header comments to the functions (at least the API functions), in the *.c files, as Michael Sweet does in CUPS. The header comments contain the descriptions and parameters of the functions. The syntax is for using the same documentation generator tool as for CUPS (seems something similar to Doxygen):

https://github.com/michaelrsweet/htmldoc

cpdb-libs and cpdb-backend-cups have comments formatted for another tool. Here we should create a script to convert the format to htmldoc.

We also need to check through all the code whether no header comments are missing or not matching the function's actual parameters.

In general, we can generate HTML, markdown, and other formats from this.

We should both generate documentation which gets installed locally by doing make install with the library's source code AND documentation to be browsed on our web site (and so also be covered by the site's search facility).

@tillkamppeter

Copy link
Copy Markdown
Member

@n0y0nD Could you take care of the conflicts and make your work applying correctly to the current state of libcupsfilters

Also, as @prisorue says, we do not only need the generated (reference) documentation, also more around it, introducing into the structures and guiding the developer how to use the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants